Finally figured it out and, like I thought, it was something simple -- Cast
the Principal:

((WSUsernameTokenPrincipal)context.getUserPrincipal()).getPassword()


mj1932 wrote:
> 
> I'm struggling to get the password from the (WS-Security) UsernameToken
> within my WebService class.  I assume I can get it from the
> WebserviceContext some how and am able to Principal.getName() from the
> WebServiceContext.  I'm using the WSS4J interceptor (with Spring ACEGI
> auth providers) to do authentication and that works, so I know the
> password is there somewhere.  Basically I need to pass along that
> WS-Security username & password "downstream" within my webservice method. 
> I've attempted to loop through the WSHandlerResults and doing sysout's see
> what's in there and don't see the password.  It's gotta be in the
> WebServiceContext somewhere.  Any help is appreciated.
> 
> Environment:
> jetty-6.1.12
> cxf 2.1.2
> spring 2.5.5
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-get-UsernameToken-password---tp19971970p19972798.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to