You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by pablo caballero <pd...@gmail.com> on 2010/02/18 17:29:02 UTC

CXF + WS - Security web service client issue

Hi everyone. I have a cxf based web service client application. Now, I
need to integrate WS - Security (UsernameToken - PasswordDigest). I
must set the wss user in every call (the username is input from the
user)
I tried to set it in the password callback but the
WSS4JOutInterceptorInternal class complains about the nonexistent user
(before the callback is called). Must I implement a prior interceptor
to set the user in the message context? Is this solution fine?

Sorry for my bad english

Thank you very much

Best regards

Re: CXF + WS - Security web service client issue

Posted by Daniel Kulp <dk...@apache.org>.
Are you using WS-SecurityPolicy?   If so, you can just set the username on the 
RequestContext and the SecurityPolicy engine would pick it up for that 
request.   You may be able to do it with older WSS4JOutInterceptor, I'm just 
not sure how.   You may be able to do it similarly with:

((BindingProvider)port).getRequestContext().put("user", "dan");

Not really sure though.

Dan


On Thu February 18 2010 11:29:02 am pablo caballero wrote:
> Hi everyone. I have a cxf based web service client application. Now, I
> need to integrate WS - Security (UsernameToken - PasswordDigest). I
> must set the wss user in every call (the username is input from the
> user)
> I tried to set it in the password callback but the
> WSS4JOutInterceptorInternal class complains about the nonexistent user
> (before the callback is called). Must I implement a prior interceptor
> to set the user in the message context? Is this solution fine?
> 
> Sorry for my bad english
> 
> Thank you very much
> 
> Best regards

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog