Package org.apache.cxf.ws.security.policy.model

Examples of org.apache.cxf.ws.security.policy.model.SecurityContextToken


        throws IllegalArgumentException {

        SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;

        SecurityContextToken contextToken = new SecurityContextToken(consts);

        String includeAttr = DOMUtils.getAttribute(element, consts.getIncludeToken());

        if (includeAttr != null) {
            contextToken.setInclusion(consts.getInclusionFromAttributeValue(includeAttr));
        }

        element = PolicyConstants.findPolicyElement(element);
        if (element == null && consts != SP11Constants.INSTANCE) {
            throw new IllegalArgumentException(
                "sp:SecurityContextToken/wsp:Policy must have a value"
            );
        }

        if (element != null) {
            if (DOMUtils.getFirstChildWithName(element,
                    consts.getNamespace(),
                    SPConstants.REQUIRE_DERIVED_KEYS) != null) {
                contextToken.setDerivedKeys(true);
            }
   
            if (DOMUtils.getFirstChildWithName(element,
                    consts.getNamespace(),
                    SPConstants.REQUIRE_EXTERNAL_URI_REFERENCE) != null) {
                contextToken.setRequireExternalUriRef(true);
            }
   
            if (DOMUtils.getFirstChildWithName(element,
                    consts.getNamespace(),
                    SPConstants.SC10_SECURITY_CONTEXT_TOKEN) != null) {
                contextToken.setSc10SecurityContextToken(true);
            }
   
            if (DOMUtils.getFirstChildWithName(element,
                    consts.getNamespace(),
                    SPConstants.SC13_SECURITY_CONTEXT_TOKEN) != null) {
                contextToken.setSc13SecurityContextToken(true);
            }
        }

        return contextToken;
    }
View Full Code Here


   
    public boolean validatePolicy(AssertionInfoMap aim) {
        Collection<AssertionInfo> sctAis = aim.get(SP12Constants.SECURITY_CONTEXT_TOKEN);
        if (sctAis != null && !sctAis.isEmpty()) {
            for (AssertionInfo ai : sctAis) {
                SecurityContextToken sctPolicy = (SecurityContextToken)ai.getAssertion();
                ai.setAsserted(true);
                   
                boolean tokenRequired = isTokenRequired(sctPolicy, message);
               
                if (!tokenRequired) {
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.security.policy.model.SecurityContextToken

Copyright © 2018 www.massapicom. 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.