Examples of AssertionInfoMap


Examples of org.apache.cxf.ws.policy.AssertionInfoMap

    static class IssuedTokenOutInterceptor extends AbstractPhaseInterceptor<Message> {
        public IssuedTokenOutInterceptor() {
            super(Phase.PREPARE_SEND);
        }
        public void handleMessage(Message message) throws Fault {
            AssertionInfoMap aim = message.get(AssertionInfoMap.class);
            // extract Assertion information
            if (aim != null) {
                Collection<AssertionInfo> ais = aim.get(SP12Constants.ISSUED_TOKEN);
                if (ais == null || ais.isEmpty()) {
                    return;
                }
                if (isRequestor(message)) {
                    IssuedToken itok = (IssuedToken)ais.iterator().next().getAssertion();
View Full Code Here

Examples of org.apache.cxf.ws.policy.AssertionInfoMap

            addAfter(WSS4JInInterceptor.class.getName());
            addAfter(PolicyBasedWSS4JInInterceptor.class.getName());
        }

        public void handleMessage(Message message) throws Fault {
            AssertionInfoMap aim = message.get(AssertionInfoMap.class);
            // extract Assertion information
            if (aim != null) {
                Collection<AssertionInfo> ais = aim.get(SP12Constants.ISSUED_TOKEN);
                if (ais == null) {
                    return;
                }
                if (!isRequestor(message)) {
                    boolean found = false;
View Full Code Here

Examples of org.apache.cxf.ws.policy.AssertionInfoMap

            return (Binding)ais.iterator().next().getAssertion();
        }
        return null;
    }
    public void handleMessage(SoapMessage message) throws Fault {
        AssertionInfoMap aim = message.get(AssertionInfoMap.class);
        // extract Assertion information
        if (aim != null) {
            Collection<AssertionInfo> ais = aim.get(SP12Constants.SECURE_CONVERSATION_TOKEN);
            if (ais == null || ais.isEmpty()) {
                return;
            }
            if (isRequestor(message)) {
                //client side should be checked on the way out
View Full Code Here

Examples of org.apache.cxf.ws.policy.AssertionInfoMap

                message.getInterceptorChain().add(i);
            }
           
            Collection<PolicyAssertion> assertions = ep.getVocabulary();
            if (null != assertions) {
                message.put(AssertionInfoMap.class, new AssertionInfoMap(assertions));
            }
            endpoint.getService().setInvoker(new STSInvoker());
            ex.put(Endpoint.class, endpoint);
            ex.put(Service.class, endpoint.getService());
            ex.put(org.apache.cxf.binding.Binding.class, endpoint.getBinding());
View Full Code Here

Examples of org.apache.cxf.ws.policy.AssertionInfoMap

    private void runInInterceptorAndValidate(Document document,
            Policy policy, List<QName> assertedInAssertions,
            List<QName> notAssertedInAssertions,
            List<CoverageType> types) throws Exception {
       
        final AssertionInfoMap aim = new AssertionInfoMap(policy);
       
        this.runInInterceptorAndValidateWss(document, aim, types);
       
        try {
            aim.checkEffectivePolicy(policy);
        } catch (PolicyException e) {
            // Expected but not relevant
        } finally {
            if (assertedInAssertions != null) {
                for (QName assertionType : assertedInAssertions) {
                    Collection<AssertionInfo> ais = aim.get(assertionType);
                    assertNotNull(ais);
                    for (AssertionInfo ai : ais) {
                        assertTrue(assertionType + " policy erroneously failed.",
                                ai.getAssertion().isAsserted(aim));
                    }
                }
            }
           
            if (notAssertedInAssertions != null) {
                for (QName assertionType : notAssertedInAssertions) {
                    Collection<AssertionInfo> ais = aim.get(assertionType);
                    assertNotNull(ais);
                    for (AssertionInfo ai : ais) {
                        assertFalse(assertionType + " policy erroneously asserted.",
                                ai.getAssertion().isAsserted(aim));
                    }
View Full Code Here

Examples of org.apache.cxf.ws.policy.AssertionInfoMap

   
    private Document runOutInterceptorAndValidate(Document document, Policy policy,
            List<QName> assertedOutAssertions,
            List<QName> notAssertedOutAssertions) throws Exception {
       
        AssertionInfoMap aim = new AssertionInfoMap(policy);
       
        final SoapMessage msg =
            this.getOutSoapMessageForDom(document, aim);
       
        return this.runOutInterceptorAndValidate(msg, policy, aim,
View Full Code Here

Examples of org.apache.cxf.ws.policy.AssertionInfoMap

       
        final Element outPolicyElement =
                this.readDocument(policyDoc).getDocumentElement();
      
        final Policy outPolicy = this.policyBuilder.getPolicy(outPolicyElement);
        final AssertionInfoMap aim = new AssertionInfoMap(outPolicy);
       
        final Document signedDoc = this.runOutInterceptorAndValidate(
                originalDoc, outPolicy, Arrays.asList(SP12Constants.ASYMMETRIC_BINDING), null);
       
        this.verifySignatureAlgorithms(signedDoc, aim);
View Full Code Here

Examples of org.apache.cxf.ws.policy.AssertionInfoMap

        final Document document = this.readDocument("wsse-request-clean.xml");
        final Element outPolicyElement =
            this.readDocument(policyDoc).getDocumentElement();
        final Policy policy = this.policyBuilder.getPolicy(outPolicyElement);
       
        AssertionInfoMap aim = new AssertionInfoMap(policy);       
        SoapMessage msg = this.getOutSoapMessageForDom(document, aim);
       
        // add an "issued" assertion into the message exchange
        Element issuedAssertion =
            this.readDocument("example-sts-issued-saml-assertion.xml").getDocumentElement();
View Full Code Here

Examples of org.apache.cxf.ws.policy.AssertionInfoMap

            }
        }
    }
   
    protected void computeAction(SoapMessage message, RequestData data) {
        AssertionInfoMap aim = message.get(AssertionInfoMap.class);
        // extract Assertion information
        String action = getString(WSHandlerConstants.ACTION, message);
        if (action == null) {
            action = "";
        }
View Full Code Here

Examples of org.apache.cxf.ws.policy.AssertionInfoMap

   
    protected void doResults(SoapMessage msg, String actor,
                             SOAPMessage doc, Vector results, boolean utWithCallbacks)
        throws SOAPException, XMLStreamException, WSSecurityException {
       
        AssertionInfoMap aim = msg.get(AssertionInfoMap.class);
        Collection<WSDataRef> signed = new HashSet<WSDataRef>();
        Collection<WSDataRef> encrypted = new HashSet<WSDataRef>();
        Boolean hasDerivedKeys = null;
        boolean hasEndorsement = false;
        Protections prots = Protections.NONE;
       
        for (int j = 0; j < results.size(); j++) {
            WSSecurityEngineResult wser =
                    (WSSecurityEngineResult) results.get(j);
            Integer actInt = (Integer)wser.get(WSSecurityEngineResult.TAG_ACTION);
            switch (actInt.intValue()) {                   
            case WSConstants.SIGN:
                if (hasDerivedKeys == null) {
                    hasDerivedKeys = Boolean.FALSE;
                }
                List<WSDataRef> sl = CastUtils.cast((List<?>)wser
                                                       .get(WSSecurityEngineResult.TAG_DATA_REF_URIS));
                if (sl != null) {
                    if (sl.size() == 1
                        && sl.get(0).getName().equals(new QName(WSConstants.SIG_NS, WSConstants.SIG_LN))) {
                        //endorsing the signature
                        hasEndorsement = true;
                        break;
                    }
                    for (WSDataRef r : sl) {
                        signed.add(r);
                    }
                    prots = addSign(prots);
                }
                break;
            case WSConstants.ENCR:
                if (hasDerivedKeys == null) {
                    hasDerivedKeys = Boolean.FALSE;
                }
                List<WSDataRef> el = CastUtils.cast((List<?>)wser
                                                       .get(WSSecurityEngineResult.TAG_DATA_REF_URIS));
                if (el != null) {
                    for (WSDataRef r : el) {
                        encrypted.add(r);
                    }
                    prots = addEncrypt(prots);
                }
                break;
            case WSConstants.UT:
                Collection<AssertionInfo> ais = aim.get(SP12Constants.USERNAME_TOKEN);
                if (ais != null) {
                    for (AssertionInfo ai : ais) {
                        ai.setAsserted(true);
                    }
                   
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.