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

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


        actions.add(WSConstants.ST_UNSIGNED);
        List<WSSecurityEngineResult> samlResults =
            WSS4JUtils.fetchAllActionResults(results, actions);
       
        for (AssertionInfo ai : ais) {
            SamlToken samlToken = (SamlToken)ai.getAssertion();
            ai.setAsserted(true);

            if (!isTokenRequired(samlToken, message)) {
                continue;
            }
View Full Code Here


        Collection<AssertionInfo> ais = aim.get(SP12Constants.SAML_TOKEN);
        if (ais != null && !ais.isEmpty()) {
            List<org.apache.cxf.ws.security.policy.model.AlgorithmSuite> samlAlgorithmSuites
                = new ArrayList<org.apache.cxf.ws.security.policy.model.AlgorithmSuite>();
            for (AssertionInfo ai : ais) {
                SamlToken samlToken = (SamlToken)ai.getAssertion();
                SupportingToken supportingToken = samlToken.getSupportingToken();
                if (supportingToken != null && supportingToken.getAlgorithmSuite() != null) {
                    samlAlgorithmSuites.add(supportingToken.getAlgorithmSuite());
                }
            }
View Full Code Here

    public Assertion build(Element element, AssertionBuilderFactory factory) {
       
        SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;

        SamlToken samlToken = new SamlToken(consts);
        samlToken.setOptional(PolicyConstants.isOptional(element));
        samlToken.setIgnorable(PolicyConstants.isIgnorable(element));

        String attribute = element.getAttributeNS(element.getNamespaceURI(), SPConstants.ATTR_INCLUDE_TOKEN);
        if (attribute != null) {
            samlToken.setInclusion(consts.getInclusionFromAttributeValue(attribute));
        }
       
        Element child = DOMUtils.getFirstElement(element);
        while (child != null) {
            String ln = child.getLocalName();
            if (org.apache.neethi.Constants.ELEM_POLICY.equals(ln)) {
                NodeList policyChildren = child.getChildNodes();
                if (policyChildren != null) {
                    for (int i = 0; i < policyChildren.getLength(); i++) {
                        Node policyChild = policyChildren.item(i);
                        if (policyChild instanceof Element) {
                            QName qname =
                                new QName(policyChild.getNamespaceURI(), policyChild.getLocalName());
                            String localname = qname.getLocalPart();
                            if (SPConstants.SAML_11_TOKEN_10.equals(localname)) {
                                samlToken.setUseSamlVersion11Profile10(true);
                            } else if (SPConstants.SAML_11_TOKEN_11.equals(localname)) {
                                samlToken.setUseSamlVersion11Profile11(true);
                            } else if (SPConstants.SAML_20_TOKEN_11.equals(localname)) {
                                samlToken.setUseSamlVersion20Profile11(true);
                            } else if (SPConstants.REQUIRE_DERIVED_KEYS.equals(localname)) {
                                samlToken.setDerivedKeys(true);
                            } else if (SPConstants.REQUIRE_EXPLICIT_DERIVED_KEYS.equals(localname)) {
                                samlToken.setExplicitDerivedKeys(true);
                            } else if (SPConstants.REQUIRE_IMPLIED_DERIVED_KEYS.equals(localname)) {
                                samlToken.setImpliedDerivedKeys(true);
                            } else if (SPConstants.REQUIRE_KEY_IDENTIFIER_REFERENCE.equals(localname)) {
                                samlToken.setRequireKeyIdentifierReference(true);
                            }
                        }
                    }
                }
            }
View Full Code Here

        List<WSSecurityEngineResult> samlResults = new ArrayList<WSSecurityEngineResult>();
        WSSecurityUtil.fetchAllActionResults(results, WSConstants.ST_SIGNED, samlResults);
        WSSecurityUtil.fetchAllActionResults(results, WSConstants.ST_UNSIGNED, samlResults);
       
        for (AssertionInfo ai : ais) {
            SamlToken samlToken = (SamlToken)ai.getAssertion();
            ai.setAsserted(true);

            if (!isTokenRequired(samlToken, message)) {
                continue;
            }
View Full Code Here

    public Assertion build(Element element, AssertionBuilderFactory factory) {
       
        SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;

        SamlToken samlToken = new SamlToken(consts);
        samlToken.setOptional(PolicyConstants.isOptional(element));
        samlToken.setIgnorable(PolicyConstants.isIgnorable(element));

        String attribute = element.getAttributeNS(element.getNamespaceURI(), SPConstants.ATTR_INCLUDE_TOKEN);
        if (attribute != null) {
            samlToken.setInclusion(consts.getInclusionFromAttributeValue(attribute));
        }
       
        Element child = DOMUtils.getFirstElement(element);
        while (child != null) {
            String ln = child.getLocalName();
            if (org.apache.neethi.Constants.ELEM_POLICY.equals(ln)) {
                NodeList policyChildren = child.getChildNodes();
                if (policyChildren != null) {
                    for (int i = 0; i < policyChildren.getLength(); i++) {
                        Node policyChild = policyChildren.item(i);
                        if (policyChild instanceof Element) {
                            QName qname =
                                new QName(policyChild.getNamespaceURI(), policyChild.getLocalName());
                            if (SPConstants.SAML_11_TOKEN_10.equals(qname.getLocalPart())) {
                                samlToken.setUseSamlVersion11Profile10(true);
                            } else if (SPConstants.SAML_11_TOKEN_11.equals(qname.getLocalPart())) {
                                samlToken.setUseSamlVersion11Profile11(true);
                            } else if (SPConstants.SAML_20_TOKEN_11.equals(qname.getLocalPart())) {
                                samlToken.setUseSamlVersion20Profile11(true);
                            }
                        }
                    }
                }
            }
View Full Code Here

        Collection<AssertionInfo> samlAis = aim.get(SP12Constants.SAML_TOKEN);
        if (samlAis != null && !samlAis.isEmpty()) {
            for (AssertionInfo ai : samlAis) {
                AssertionWrapper assertionWrapper =
                    (AssertionWrapper)wser.get(WSSecurityEngineResult.TAG_SAML_ASSERTION);
                SamlToken samlToken = (SamlToken)ai.getAssertion();
                ai.setAsserted(true);

                if (!checkVersion(samlToken, assertionWrapper)) {
                    ai.setNotAsserted("Wrong SAML Version");
                    return false;
View Full Code Here

    public Assertion build(Element element, AssertionBuilderFactory factory) {
       
        SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;

        SamlToken samlToken = new SamlToken(consts);
        samlToken.setOptional(PolicyConstants.isOptional(element));
        samlToken.setIgnorable(PolicyConstants.isIgnorable(element));

        String attribute = element.getAttributeNS(element.getNamespaceURI(), SPConstants.ATTR_INCLUDE_TOKEN);
        if (attribute != null) {
            samlToken.setInclusion(consts.getInclusionFromAttributeValue(attribute));
        }
       
        Element child = DOMUtils.getFirstElement(element);
        while (child != null) {
            String ln = child.getLocalName();
            if (org.apache.neethi.Constants.ELEM_POLICY.equals(ln)) {
                NodeList policyChildren = child.getChildNodes();
                if (policyChildren != null) {
                    for (int i = 0; i < policyChildren.getLength(); i++) {
                        Node policyChild = policyChildren.item(i);
                        if (policyChild instanceof Element) {
                            QName qname =
                                new QName(policyChild.getNamespaceURI(), policyChild.getLocalName());
                            if (SPConstants.SAML_11_TOKEN_10.equals(qname.getLocalPart())) {
                                samlToken.setUseSamlVersion11Profile10(true);
                            } else if (SPConstants.SAML_11_TOKEN_11.equals(qname.getLocalPart())) {
                                samlToken.setUseSamlVersion11Profile11(true);
                            } else if (SPConstants.SAML_20_TOKEN_11.equals(qname.getLocalPart())) {
                                samlToken.setUseSamlVersion20Profile11(true);
                            }
                        }
                    }
                }
            }
View Full Code Here

        Collection<AssertionInfo> ais = aim.get(SP12Constants.SAML_TOKEN);
        if (ais != null && !ais.isEmpty()) {
            List<org.apache.cxf.ws.security.policy.model.AlgorithmSuite> samlAlgorithmSuites
                = new ArrayList<org.apache.cxf.ws.security.policy.model.AlgorithmSuite>();
            for (AssertionInfo ai : ais) {
                SamlToken samlToken = (SamlToken)ai.getAssertion();
                SupportingToken supportingToken = samlToken.getSupportingToken();
                if (supportingToken != null && supportingToken.getAlgorithmSuite() != null) {
                    samlAlgorithmSuites.add(supportingToken.getAlgorithmSuite());
                }
            }
View Full Code Here

    public Assertion build(Element element, AssertionBuilderFactory factory) {
       
        SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;

        SamlToken samlToken = new SamlToken(consts);
        samlToken.setOptional(PolicyConstants.isOptional(element));
        samlToken.setIgnorable(PolicyConstants.isIgnorable(element));

        String attribute = element.getAttributeNS(element.getNamespaceURI(), SPConstants.ATTR_INCLUDE_TOKEN);
        if (attribute != null) {
            samlToken.setInclusion(consts.getInclusionFromAttributeValue(attribute));
        }
       
        Element child = DOMUtils.getFirstElement(element);
        boolean foundPolicy = false;
        while (child != null) {
            String ln = child.getLocalName();
            if (org.apache.neethi.Constants.ELEM_POLICY.equals(ln)) {
                foundPolicy = true;
                samlToken.setPolicy(child);
                NodeList policyChildren = child.getChildNodes();
                if (policyChildren != null) {
                    for (int i = 0; i < policyChildren.getLength(); i++) {
                        Node policyChild = policyChildren.item(i);
                        if (policyChild instanceof Element) {
                            QName qname =
                                new QName(policyChild.getNamespaceURI(), policyChild.getLocalName());
                            String localname = qname.getLocalPart();
                            if (SPConstants.SAML_11_TOKEN_10.equals(localname)) {
                                samlToken.setUseSamlVersion11Profile10(true);
                            } else if (SPConstants.SAML_11_TOKEN_11.equals(localname)) {
                                samlToken.setUseSamlVersion11Profile11(true);
                            } else if (SPConstants.SAML_20_TOKEN_11.equals(localname)) {
                                samlToken.setUseSamlVersion20Profile11(true);
                            } else if (SPConstants.REQUIRE_DERIVED_KEYS.equals(localname)) {
                                samlToken.setDerivedKeys(true);
                            } else if (SPConstants.REQUIRE_EXPLICIT_DERIVED_KEYS.equals(localname)) {
                                samlToken.setExplicitDerivedKeys(true);
                            } else if (SPConstants.REQUIRE_IMPLIED_DERIVED_KEYS.equals(localname)) {
                                samlToken.setImpliedDerivedKeys(true);
                            } else if (SPConstants.REQUIRE_KEY_IDENTIFIER_REFERENCE.equals(localname)) {
                                samlToken.setRequireKeyIdentifierReference(true);
                            }
                        }
                    }
                }
            }
View Full Code Here

        List<WSSecurityEngineResult> samlResults = new ArrayList<WSSecurityEngineResult>();
        WSSecurityUtil.fetchAllActionResults(results, WSConstants.ST_SIGNED, samlResults);
        WSSecurityUtil.fetchAllActionResults(results, WSConstants.ST_UNSIGNED, samlResults);
       
        for (AssertionInfo ai : ais) {
            SamlToken samlToken = (SamlToken)ai.getAssertion();
            ai.setAsserted(true);

            if (!isTokenRequired(samlToken, message)) {
                continue;
            }
View Full Code Here

TOP

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

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.