There is a section on http://cxf.apache.org/docs/ws-security.html that
defines how to handle plain text username/password.

1. Add WSS4JOutInterceptor to you CXF endpoint out interceptors with
following configuration options:
props.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
props.put(WSHandlerConstants.USER, username);
props.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
props.put(WSHandlerConstants.PW_CALLBACK_CLASS,
ClientPasswordHandler.class.getName());

2. Implement CallbackHandler interface to return password details
public class ClientPasswordCallback implements CallbackHandler {
 
    public void handle(Callback[] callbacks) throws IOException, 
        UnsupportedCallbackException {
 
        WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
 
        // set the password for our message.
        pc.setPassword("password");
    }
 
}



--
View this message in context: 
http://camel.465427.n5.nabble.com/CxfEndpoint-soap-client-usernametoken-authentication-tp5787910p5788698.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to