Examples of WSS4JStaxOutInterceptor


Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

            // expected
        }
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        WSS4JStaxOutInterceptor staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
       
        try {
            port.doubleIt(25);
            fail("Failure expected on not signing the WS-Addressing headers");
        } catch (Exception ex) {
            // expected
        }
        bus.getOutInterceptors().remove(staxOutInterceptor);
       
        // Now sign the WS-Addressing headers
        outProps.put("signatureParts",
                "{}{http://schemas.xmlsoap.org/soap/envelope/}Body;"
                + "{}{http://docs.oasis-open.org/wss/2004/01/oasis-"
                + "200401-wss-wssecurity-utility-1.0.xsd}Timestamp;"
                + "{}{http://www.w3.org/2005/08/addressing}ReplyTo;");
       
        // DOM
        outInterceptor = new WSS4JOutInterceptor(outProps);
        bus.getOutInterceptors().add(outInterceptor);
       
        port.doubleIt(25);
        bus.getOutInterceptors().remove(outInterceptor);
       
        // Streaming
        staxOutInterceptor = new WSS4JStaxOutInterceptor(outProps);
        bus.getOutInterceptors().add(staxOutInterceptor);
       
        port.doubleIt(25);
       
        ((java.io.Closeable)port).close();
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

        properties.addSignaturePart(
            new SecurePart(new QName(WSSConstants.NS_SOAP11, "Body"), SecurePart.Modifier.Content)
        );
        properties.setCallbackHandler(new UTPasswordCallback());
       
        WSS4JStaxOutInterceptor ohandler = new WSS4JStaxOutInterceptor(properties);
        bus.getOutInterceptors().add(ohandler);
       
        WSSSecurityProperties inProperties = new WSSSecurityProperties();
        inProperties.addAction(WSSConstants.USERNAMETOKEN);
        inProperties.addAction(WSSConstants.TIMESTAMP);
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

                new SecurePart(new QName("http://www.w3.org/2005/08/addressing", "ReplyTo"),
                    SecurePart.Modifier.Element)
            );
            properties.setCallbackHandler(new UTPasswordCallback());
           
            WSS4JStaxOutInterceptor ohandler = new WSS4JStaxOutInterceptor(properties);
            bus.getOutInterceptors().add(ohandler);
           
            WSSSecurityProperties inProperties = new WSSSecurityProperties();
            inProperties.addAction(WSSConstants.USERNAMETOKEN);
            inProperties.addAction(WSSConstants.TIMESTAMP);
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

           
            GreeterService service = new GreeterService();
            Greeter port = service.getGreeterPort();
            org.apache.cxf.endpoint.Client client = ClientProxy.getClient(port);
            client.getInInterceptors().add(new WSS4JStaxInInterceptor(inProperties));
            client.getOutInterceptors().add(new WSS4JStaxOutInterceptor(properties));

            String[] names = new String[] {"Anne", "Bill", "Chris", "Scott"};
            // make a sequence of 4 invocations
            for (int i = 0; i < 4; i++) {
                System.out.println("Invoking greetMe...");
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

        properties.setUsernameTokenPasswordType(WSSConstants.UsernameTokenPasswordType.PASSWORD_TEXT);
        properties.setTokenUser("Alice");
       
        properties.setCallbackHandler(new UTPasswordCallback());
       
        impl.getOutInterceptors().add(new WSS4JStaxOutInterceptor(properties));

        WSSSecurityProperties inProperties = new WSSSecurityProperties();
        inProperties.addAction(WSSConstants.USERNAMETOKEN);
        inProperties.addAction(WSSConstants.TIMESTAMP);
        inProperties.setUsernameTokenPasswordType(WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST);
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

                new SecurePart(new QName("http://www.w3.org/2005/08/addressing", "ReplyTo"),
                    SecurePart.Modifier.Element)
            );
            properties.setCallbackHandler(new UTPasswordCallback());
           
            WSS4JStaxOutInterceptor ohandler = new WSS4JStaxOutInterceptor(properties);
            bus.getOutInterceptors().add(ohandler);
           
            WSSSecurityProperties inProperties = new WSSSecurityProperties();
            inProperties.setCallbackHandler(new UTPasswordCallback());
            inProperties.setDecryptionCryptoProperties(sigCryptoProperties);
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

       
        WSSSecurityProperties properties = new WSSSecurityProperties();
        properties.setOutAction(new XMLSecurityConstants.Action[]{WSSConstants.SAML_TOKEN_UNSIGNED});
        properties.setSamlCallbackHandler(new SAML1CallbackHandler());
       
        WSS4JStaxOutInterceptor ohandler = new WSS4JStaxOutInterceptor(properties);
        client.getOutInterceptors().add(ohandler);

        assertEquals("test", echo.echo("test"));
    }
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

        client.getOutInterceptors().add(new LoggingOutInterceptor());
       
        Map<String, Object> outConfig = new HashMap<String, Object>();
        outConfig.put(ConfigurationConstants.ACTION, ConfigurationConstants.SAML_TOKEN_UNSIGNED);
        outConfig.put(ConfigurationConstants.SAML_CALLBACK_REF, new SAML1CallbackHandler());
        WSS4JStaxOutInterceptor ohandler = new WSS4JStaxOutInterceptor(outConfig);
       
        client.getOutInterceptors().add(ohandler);

        assertEquals("test", echo.echo("test"));
    }
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

       
        properties.setSignatureKeyIdentifier(
            WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference
        );
       
        WSS4JStaxOutInterceptor ohandler = new WSS4JStaxOutInterceptor(properties);
        client.getOutInterceptors().add(ohandler);

        assertEquals("test", echo.echo("test"));
    }
View Full Code Here

Examples of org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor

        Map<String, Object> outConfig = new HashMap<String, Object>();
        outConfig.put(ConfigurationConstants.ACTION, ConfigurationConstants.SAML_TOKEN_SIGNED);
        outConfig.put(ConfigurationConstants.SAML_CALLBACK_REF, new SAML1CallbackHandler());
        outConfig.put(ConfigurationConstants.PW_CALLBACK_REF, new PasswordCallbackHandler());
        outConfig.put(ConfigurationConstants.SIG_KEY_ID, "DirectReference");
        WSS4JStaxOutInterceptor ohandler = new WSS4JStaxOutInterceptor(outConfig);

        client.getOutInterceptors().add(ohandler);

        assertEquals("test", echo.echo("test"));
    }
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.