Examples of SecurityContextToken


Examples of org.apache.ws.sandbox.security.conversation.message.token.SecurityContextToken

        String uuid = null;

                try {
          if (dkToken.getSecuityTokenReference() == null) {
            //if dkToken doesn't have a STR
            SecurityContextToken secContextTk =
              ConversationUtil.getSCT(dkToken);
            uuid = secContextTk.getIdentifier();
            log.debug(
              "ConversationEngine :: The uuid is found " + uuid);
            dkInfo = new DerivedKeyInfo(dkToken);
            dkcbHandler.addDerivedKey(uuid, dkInfo);
          } else { ///i.e. dkToken has a STR
View Full Code Here

Examples of org.apache.ws.secpolicy.model.SecurityContextToken

public class SecurityContextTokenBuilder implements AssertionBuilder {

    public Assertion build(OMElement element, AssertionBuilderFactory factory)
            throws IllegalArgumentException {

        SecurityContextToken contextToken = new SecurityContextToken();

        OMAttribute attribute = element.getAttribute(Constants.INCLUDE_TOKEN);
        if (attribute == null) {
            throw new IllegalArgumentException(
                    "SecurityContextToken doesn't contain any sp:IncludeToken attribute");
        }
       
        String inclusionValue = attribute.getAttributeValue().trim();
       
        if (inclusionValue.endsWith(Constants.INCLUDE_NEVER)) {
            contextToken.setInclusion(Constants.INCLUDE_NEVER);

        } else if (inclusionValue.endsWith(Constants.INCLUDE_ONCE)) {
            contextToken.setInclusion(Constants.INCLUDE_ONCE);

        } else if (inclusionValue
                .endsWith(Constants.INCLUDE_ALWAYS_TO_RECIPIENT)) {
            contextToken.setInclusion(Constants.INCLUDE_ALWAYS_TO_RECIPIENT);

        } else if (inclusionValue.endsWith(Constants.INCLUDE_ALWAYS)) {
            contextToken.setInclusion(Constants.INCLUDE_ALWAYS);
        }

        element = element.getFirstChildWithName(Constants.POLICY);

        if (element != null) {

            if (element.getFirstChildWithName(Constants.REQUIRE_DERIVED_KEYS) != null) {
                contextToken.setDerivedKeys(true);
            }

            if (element
                    .getFirstChildWithName(Constants.REQUIRE_EXTERNAL_URI_REFERNCE) != null) {
                contextToken.setRequireExternalUriRef(true);
            }

            if (element
                    .getFirstChildWithName(Constants.SC10_SECURITY_CONTEXT_TOKEN) != null) {
                contextToken.setSc10SecurityContextToken(true);
            }
        }

        return contextToken;
    }
View Full Code Here

Examples of org.apache.ws.security.conversation.message.token.SecurityContextToken

                        doc.getDocumentElement(),
                        true);
                WSSecurityUtil.appendChildElement(
                    doc,
                    securityHeader,
                    (new SecurityContextToken(doc, uuid)).getElement());
                ConversationManager manager = new ConversationManager();
                for (int i = 0; i < this.actionsInt.length; i++) {
                    // Derrive the token
                    DerivedKeyInfo dkInfo =
                        manager.createDerivedKeyToken(doc, uuid, dkcbHandler,null, keyLen);
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityContextToken

                        );
                    }
                    return tokenElement;
                } else if (actInt == WSConstants.SCT) {
                    // Need to check special case of SecurityContextToken Identifier separately
                    SecurityContextToken sct =
                        (SecurityContextToken)
                            engineResult.get(WSSecurityEngineResult.TAG_SECURITY_CONTEXT_TOKEN);
                    if (referenceURI.equals(sct.getIdentifier())) {
                        return sct.getElement();
                    }
                }
            }
        }
        throw new STSException("Cannot retreive token from reference", STSException.REQUEST_FAILED);
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityContextToken

                    WSSecurityEngineResult wser = (WSSecurityEngineResult) wsSecEngineResults
                            .get(j);
                    final Integer actInt =
                        (Integer)wser.get(WSSecurityEngineResult.TAG_ACTION);
                    if(WSConstants.SCT == actInt.intValue()) {
                        final SecurityContextToken sct =
                            ((SecurityContextToken) wser
                                .get(WSSecurityEngineResult.TAG_SECURITY_CONTEXT_TOKEN));
                        id = sct.getID();
                    }

                }
            }
        }
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityContextToken

    public void handleToken(Element elem, Crypto crypto, Crypto decCrypto,
            CallbackHandler cb, WSDocInfo wsDocInfo, Vector returnResults,
            WSSConfig config) throws WSSecurityException {

        SecurityContextToken sct = new SecurityContextToken(elem);
        this.identifier = sct.getIdentifier();
        this.secret = this.getSecret(cb, sct);
        this.sctId = sct.getID();
    }
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityContextToken

    public void prepare(Document doc, Crypto crypto)
            throws WSSecurityException {

        if (sct == null) {
            if (this.identifier != null) {
                this.sct = new SecurityContextToken(doc, this.identifier);
            } else {
                this.sct = new SecurityContextToken(doc);
                this.identifier = this.sct.getIdentifier();
            }
        }

        // The wsu:Id of the wsc:SecurityContextToken
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityContextToken

    public void prepare(Document doc, Crypto crypto)
            throws WSSecurityException, ConversationException  {

        if (sct == null) {
            if (this.identifier != null) {
                this.sct = new SecurityContextToken(this.wscVersion, doc, this.identifier);
            } else {
                this.sct = new SecurityContextToken(this.wscVersion, doc);
                this.identifier = this.sct.getIdentifier();
            }
        }

        // The wsu:Id of the wsc:SecurityContextToken
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityContextToken

    public void handleToken(Element elem, Crypto crypto, Crypto decCrypto,
            CallbackHandler cb, WSDocInfo wsDocInfo, Vector returnResults,
            WSSConfig config) throws WSSecurityException {

        SecurityContextToken sct = new SecurityContextToken(elem);
        this.identifier = sct.getIdentifier();
        this.secret = this.getSecret(cb, sct);
        this.sctId = sct.getID();
       
        returnResults.add(0, new WSSecurityEngineResult(WSConstants.SCT, sct));
    }
View Full Code Here

Examples of org.apache.ws.security.message.token.SecurityContextToken

                        );
                    }
                    return new ReceivedToken(tokenElement);
                } else if (actInt == WSConstants.SCT) {
                    // Need to check special case of SecurityContextToken Identifier separately
                    SecurityContextToken sct =
                        (SecurityContextToken)
                            engineResult.get(WSSecurityEngineResult.TAG_SECURITY_CONTEXT_TOKEN);
                    if (referenceURI.equals(sct.getIdentifier())) {
                        return new ReceivedToken(sct.getElement());
                    }
                }
            }
        }
        throw new STSException("Cannot retreive token from reference", STSException.REQUEST_FAILED);
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.