Examples of WSS4JOutInterceptor


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

       
        Client client = ClientProxy.getClient(greeter);
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("action", "UsernameToken");
        props.put("user", "alice");
        WSS4JOutInterceptor wss4jOut = new WSS4JOutInterceptor(props);
       
        client.getOutInterceptors().add(wss4jOut);

        ((BindingProvider)greeter).getRequestContext().put("password", "password");
        String s = greeter.greetMe("CXF");
View Full Code Here

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

       
        Client client = ClientProxy.getClient(greeter);
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("action", "UsernameToken");
        props.put("user", "alice");
        WSS4JOutInterceptor wss4jOut = new WSS4JOutInterceptor(props);
       
        client.getOutInterceptors().add(wss4jOut);

        ((BindingProvider)greeter).getRequestContext().put("password", "password");
        String s = greeter.greetMe("CXF");
View Full Code Here

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

       
        Client client = ClientProxy.getClient(greeter);
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("action", "UsernameToken");
        props.put("user", "alice");
        WSS4JOutInterceptor wss4jOut = new WSS4JOutInterceptor(props);
       
        client.getOutInterceptors().add(wss4jOut);

        ((BindingProvider)greeter).getRequestContext().put("password", "password");
        String s = greeter.greetMe("CXF");
View Full Code Here

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

        List<String> xpaths,
        Map<String, Object> inProperties
    ) throws Exception {
        Document doc = readDocument("wsse-request-clean.xml");

        WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor();
        PhaseInterceptor<SoapMessage> handler = ohandler.createEndingInterceptor();

        SoapMessage msg = new SoapMessage(new MessageImpl());
        Exchange ex = new ExchangeImpl();
        ex.setInMessage(msg);
View Full Code Here

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

       
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setServiceClass(AegisJaxWs.class);
        if (sec) {
            factory.setAddress("http://localhost:" + PORT + "/aegisJaxWsUN");
            WSS4JOutInterceptor wss4jOut = new WSS4JOutInterceptor();
            wss4jOut.setProperty("action", "UsernameToken");
            wss4jOut.setProperty("user", "alice");
            wss4jOut.setProperty("password", "pass");
           
            factory.setProperties(new HashMap<String, Object>());
            factory.getProperties().put("password", "pass");
            factory.getOutInterceptors().add(wss4jOut);
        } else {
View Full Code Here

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

       
        Client client = ClientProxy.getClient(greeter);
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("action", "UsernameToken");
        props.put("user", "alice");
        WSS4JOutInterceptor wss4jOut = new WSS4JOutInterceptor(props);
       
        client.getOutInterceptors().add(wss4jOut);

        ((BindingProvider)greeter).getRequestContext().put("password", "password");
        String s = greeter.greetMe("CXF");
View Full Code Here

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

            outProps.put("passwordType", "PasswordDigest");
            outProps.put("user", "abcd");
            outProps.put("passwordCallbackClass", "demo.wssec.client.UTPasswordCallback");

            bus.getOutInterceptors().add(new WSS4JOutInterceptor(outProps));

            Map<String, Object> inProps = new HashMap<String, Object>();
            inProps.put("action", "UsernameToken Timestamp");
            inProps.put("passwordType", "PasswordText");
            inProps.put("passwordCallbackClass", "demo.wssec.client.UTPasswordCallback");
View Full Code Here

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

       
        Client client = ClientProxy.getClient(svc);
        client.getEndpoint().getEndpointInfo().setAddress(
                                "http://localhost:" + PORT + "/JavaFirstAttachmentPolicyService");
      
        WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor();
        client.getEndpoint().getOutInterceptors().add(wssOut);
       
        // just some basic sanity tests first to make sure that auth is working where password is provided.
        wssOut.setProperties(getPasswordProperties("alice", "password"));
        svc.doInputMessagePolicy();
       
        wssOut.setProperties(getPasswordProperties("alice", "passwordX"));
        try {
            svc.doInputMessagePolicy();
            fail("Expected authentication failure");
        } catch (Exception e) {
            assertTrue(true);
        }
       
        wssOut.setProperties(getNoPasswordProperties("alice"));
       
        try {
            svc.doInputMessagePolicy();
            fail("Expected authentication failure");
        } catch (Exception e) {
View Full Code Here

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

       
        Client client = ClientProxy.getClient(svc);
        client.getEndpoint().getEndpointInfo().setAddress(
                                "https://localhost:" + PORT2 + "/SslUsernamePasswordAttachmentService");
      
        WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor();
        client.getEndpoint().getOutInterceptors().add(wssOut);
       
        // just some basic sanity tests first to make sure that auth is working where password is provided.
        wssOut.setProperties(getPasswordProperties("alice", "password"));
        svc.doSslAndUsernamePasswordPolicy();
       
        wssOut.setProperties(getPasswordProperties("alice", "passwordX"));
        try {
            svc.doSslAndUsernamePasswordPolicy();
            fail("Expected authentication failure");
        } catch (Exception e) {
            assertTrue(true);
        }
       
        wssOut.setProperties(getNoPasswordProperties("alice"));
       
        try {
            svc.doSslAndUsernamePasswordPolicy();
            fail("Expected authentication failure");
        } catch (Exception e) {
View Full Code Here

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

            outProps.put("signatureKeyIdentifier", "DirectReference");
            outProps.put("signatureParts",
                         "{Element}{" + WSU_NS + "}Timestamp;"
                         + "{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body");

            bus.getOutInterceptors().add(new WSS4JOutInterceptor(outProps));

            Map<String, Object> inProps = new HashMap<String, Object>();

            inProps.put("action", "UsernameToken Timestamp Signature");
            inProps.put("passwordType", "PasswordText");
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.