Examples of RequestSecurityTokenResponse


Examples of com.sun.xml.ws.security.trust.elements.RequestSecurityTokenResponse

        if (rstCtx != null){
            ctx = URI.create(rstCtx);
        }
     
        // Create RequestSecurityTokenResponse
        final RequestSecurityTokenResponse rstr =
                eleFac.createRSTRForIssue(URI.create(tokenType), ctx, reqSecTok, applies, raRef, ruRef, proofToken, serverEntropy, lifetime);
       
        if (keySize > 0){
            rstr.setKeySize(keySize);
        }
       
        this.handleExtension(rst, rstr, context);
       
        if(log.isLoggable(Level.FINE)) {
View Full Code Here

Examples of com.sun.xml.ws.security.trust.elements.RequestSecurityTokenResponse

            Token issuedToken = context.getSecurityToken();
            reqSecTok.setToken(issuedToken);
        }
       
        // Create RequestSecurityTokenResponse
        final RequestSecurityTokenResponse rstr = eleFac.createRSTRForValidate(tokenType, reqSecTok, (Status)context.getOtherProperties().get(IssuedTokenContext.STATUS));
       
        if (wstVer.getNamespaceURI().equals(WSTrustVersion.WS_TRUST_13.getNamespaceURI())){
            List<RequestSecurityTokenResponse> list = new ArrayList<RequestSecurityTokenResponse>();
            list.add(rstr);
            RequestSecurityTokenResponseCollection rstrc = eleFac.createRSTRC(list);
View Full Code Here

Examples of org.apache.axis2.security.trust.token.RequestSecurityTokenResponse

            options.setTo(new EndpointReference(this.stsUrl));
            options.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY, this.outConfig.getProperty());
            options.setProperty(WSSHandlerConstants.INFLOW_SECURITY, this.inConfig.getProperty());

            OMElement res = call.invokeBlocking(Constants.LN.REQUEST_SECURITY_TOKEN, this.prepareRequst(rst));
            RequestSecurityTokenResponse rstr = new RequestSecurityTokenResponse(res);
            return rstr;
        } catch (AxisFault e) {
            throw new TrustException("Problem in communicating with the SecurityTokenService", e);
        }
    }
View Full Code Here

Examples of org.apache.ws.sandbox.security.trust.message.token.RequestSecurityTokenResponse

        Element eleSTRes,
        DerivedKeyCallbackHandler dkcbHandler,
        String callback)
        throws ConversationException {
        String uuid = null;
        RequestSecurityTokenResponse stRes = null;

        try {
            if (verifyTrust) {
                TrustEngine trstEngine = new TrustEngine(this.trustPropFile);
               
                // TODO :: Verify trust......
                System.out.println("...........Verifying trust.........");

            }

            //Now trust is verified.

            stRes = new RequestSecurityTokenResponse(eleSTRes, true);
            SecurityContextToken SCT =
                stRes.getRequestedSecurityToken().getSct();
            uuid = SCT.getIdentifier();
            RequestedProofToken proofToken = stRes.getRequestedProofToken();
            //TODO:: romove the hard coded decryption

            proofToken.doDecryption(callback, this.loadDecryptionCrypto());

            SecurityContextInfo scInfo = null;
View Full Code Here

Examples of org.apache.ws.sandbox.security.trust.message.token.RequestSecurityTokenResponse

    //x509=new X509Security(binarySecurity.getElement());
    Element sct=this.getSecuritContextToken(res,x509);   
   
    /////////////////////////////////////////////////////////////////////////////
    //Now we build the response
    RequestSecurityTokenResponse requestSecurityTokenResponse=new RequestSecurityTokenResponse(res);
   
    RequestedSecurityToken requestedSecurityToken=new RequestedSecurityToken(res);
    //Token Type
    TokenType tokenTypeRes=new TokenType(res);
    tokenTypeRes.setValue(tokenType.getValue());
View Full Code Here

Examples of org.apache.ws.sandbox.security.trust.message.token.RequestSecurityTokenResponse

            log.debug("ConversationClientHandler :: Trust Not required");
            doc =
                ((org.apache.axis.message.SOAPEnvelope) sPart.getEnvelope())
                    .getAsDocument();
            this.initSessionInfo();
            this.stRes = new RequestSecurityTokenResponse(doc, true);

        } catch (Exception e) {
            e.printStackTrace();
            throw new AxisFault(
                "ConversationClientHandler ::" + e.getMessage());
View Full Code Here

Examples of org.apache.ws.sandbox.security.trust.message.token.RequestSecurityTokenResponse

        Element eleSTRes,
        DerivedKeyCallbackHandler dkcbHandler,
        String callback)
        throws ConversationException {
        String uuid = null;
        RequestSecurityTokenResponse stRes = null;

        try {
            if (verifyTrust) {
                TrustEngine trstEngine = new TrustEngine(this.trustPropFile);
               
                // TODO :: Verify trust......
                System.out.println("...........Verifying trust.........");

            }

            //Now trust is verified.

            stRes = new RequestSecurityTokenResponse(eleSTRes, true);
            SecurityContextToken SCT =
                stRes.getRequestedSecurityToken().getSct();
            uuid = SCT.getIdentifier();
            RequestedProofToken proofToken = stRes.getRequestedProofToken();
            //TODO:: romove the hard coded decryption

            proofToken.doDecryption(callback, this.loadDecryptionCrypto());

            SecurityContextInfo scInfo = null;
View Full Code Here

Examples of org.apache.ws.sandbox.security.trust.message.token.RequestSecurityTokenResponse

            log.debug("ConversationClientHandler :: Trust Not required");
            doc =
                ((org.apache.axis.message.SOAPEnvelope) sPart.getEnvelope())
                    .getAsDocument();
            this.initSessionInfo();
            this.stRes = new RequestSecurityTokenResponse(doc, true);

        } catch (Exception e) {
            e.printStackTrace();
            throw new AxisFault(
                "ConversationClientHandler ::" + e.getMessage());
View Full Code Here

Examples of org.apache.ws.sandbox.security.trust2.RequestSecurityTokenResponse

                    // or a <SecurityTokenReference> element to a security token found elsewhere
                    requestedToken = new SecurityTokenOrReference(userToken);
                }
       
                // Create our response object, giving it an XML document object to use for element creation, along with our requestedToken object
                RequestSecurityTokenResponse tokenResponse = new RequestSecurityTokenResponse(doc, requestedToken);
       
                // Set the Context of the response, according to WS-Trust, this must be the same as the Context of the request
                tokenResponse.setContext(tokenRequest.getContext());
       
                // Set the TokenType of the response. To make clients happy we'll return a token of the type they requested
                tokenResponse.setTokenType(tokenRequest.getTokenType());
       
                // Add a Lifetime element to indicate to clients the lifetime of the token we're sending
                // In this case, we're giving the client the lifetime they asked for
                Lifetime lifetime = tokenRequest.getLifetime();
                tokenResponse.setLifetime(lifetime);

                // Check if the request included a custom element named <TestElement>
                // Note that a list of custom elements can be obtained by calling getCustomElements();
                if (tokenRequest.getCustomElement("http://testElementNs.testElementNs", "TestElement") != null) {
                    // If it did we'll add our own custom element to the response
                    tokenResponse.addCustomElementNS("http://testElementNs.testElementNs", "te:TestElementResponse");
                }
       
                // Return the response object. If our Axis Serializers are configured correctly, this should automatically get converted to XML
                return tokenResponse;
            }
View Full Code Here

Examples of org.apache.ws.sandbox.security.trust2.RequestSecurityTokenResponse

   
        // Find the <RequestSecurityTokenResponse> element the SOAP body should contain
        SOAPBodyElement responseBody = response.getBodyByName(TrustConstants.WST_NS, TrustConstants.RESPONSE_TAG);

        // Construct a Java object from the XML
        RequestSecurityTokenResponse tokenResponse = new RequestSecurityTokenResponse(responseBody.getAsDOM());

        System.out.println("\n------- RequestSecurityTokenResponse object ------------- \n" + tokenResponse);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.