You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by catequil <br...@yahoo.com> on 2016/10/11 19:09:40 UTC

Re: CxfEndpoint soap client usernametoken authentication

Just was wondering if anyone had thought about a solution to this issue yet?



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

Re: CxfEndpoint soap client usernametoken authentication

Posted by catequil <br...@yahoo.com>.
In step 1 you set 4 props.  Where would these props get set in the DSL?  or
can I somehow set them in the camel-config.xml as part of the cxfendpoint
element?  This part is a little vague to me.  I hope you can help?
Thanks!



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

Re: CxfEndpoint soap client usernametoken authentication

Posted by dmitriyC300 <dm...@gmail.com>.
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.