Examples of WSS4JOutInterceptor


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

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

        return new WSS4JOutInterceptor(outProps);
   
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");
        props.put("passwordType", "PasswordText");
        WSS4JOutInterceptor wss4jOut = new WSS4JOutInterceptor(props);
       
        client.getOutInterceptors().add(wss4jOut);

        ((BindingProvider)greeter).getRequestContext().put("password", "password");
       
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

         client.getInInterceptors().add(inInterceptor);
      }

      if (outPropertyMap != null && handleSpecialProperties(outPropertyMap))
      {
         WSS4JOutInterceptor outInterceptor = new WSS4JOutInterceptor(outPropertyMap);
         client.getOutInterceptors().add(outInterceptor);
      }
   }
View Full Code Here

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

        Endpoint cxfEndpoint = client.getEndpoint();
               
        if (!wss4jOutProps.isEmpty()) {
            // pass the security properties to the WSS4J out interceptor
            updateSecurityProperties(wss4jOutProps);
            WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(wss4jOutProps);
            cxfEndpoint.getOutInterceptors().add(wssOut);
        }
       
        if (!wss4jInProps.isEmpty()) {
            // pass the security properties to the WSS4J in interceptor
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:9167/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

         server.getEndpoint().getInInterceptors().add(inInterceptor);
      }
     
      if (outPropertyMap != null)
      {
         WSS4JOutInterceptor outInterceptor = new WSS4JOutInterceptor(outPropertyMap);
         server.getEndpoint().getOutInterceptors().add(outInterceptor);
      }
   }
View Full Code Here

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

         client.getInInterceptors().add(inInterceptor);
      }

      if (outPropertyMap != null && handleSpecialProperties(outPropertyMap))
      {
         WSS4JOutInterceptor outInterceptor = new WSS4JOutInterceptor(outPropertyMap);
         client.getOutInterceptors().add(outInterceptor);
      }
   }
View Full Code Here

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

            Map<String, Object> bookProps = new HashMap<String, Object>();
            bookProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
            bookProps.put(WSHandlerConstants.USER, "soap");
            bookProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_DIGEST);
            bookProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, PasswordCallback.class.getName());
            WSS4JOutInterceptor wssBookOut = new WSS4JOutInterceptor(bookProps);
            bookEndPoint.getOutInterceptors().add(wssBookOut);

            // Authentication of reader web service
            Client readerClient = ClientProxy.getClient(readerWebService);
            Endpoint readerEndPoint = readerClient.getEndpoint();
            Map<String, Object> readerProps = new HashMap<String, Object>();
            readerProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
            readerProps.put(WSHandlerConstants.USER, "soap");
            readerProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_DIGEST);
            readerProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, PasswordCallback.class.getName());
            WSS4JOutInterceptor wssReaderOut = new WSS4JOutInterceptor(readerProps);
            readerEndPoint.getOutInterceptors().add(wssReaderOut);

            setTitle("Library");

            libraryMenu = new LibraryMenuBar();
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.