The easiest is to inject in the WebServiceContext using an @Resource. Then you have two options:
1) The WebServiceContext has a getUserPrincipal() method that can be used to retrieve the principal object that WSS4J gives us. However, if you also use basic auth or similar or there are multiple principals returned from wss4j (multiple keys or similar), you may not get the one you really want. 2) From the context, get "RECV_RESULTS" which is a List of objects of stuff that WSS4J did. A bit "raw" to deal with, but the results you would want are in there someplace. Dan On Tue October 20 2009 6:49:19 am Marek Kasztelnik wrote: > Hi, > > I use ws-security for authentication and authorization in my web > service. Additionally, in the web service implementation I would like to > use delivered credentials to generate and return personalized data to > the user. I have been googling and searching in cxf documentation, > unfortunately without any success. > > What I need is a possibility to get user id in web service > implementation. Could you give me a hint how it can be implemented? > > greetings from Krakow, > -- Daniel Kulp [email protected] http://www.dankulp.com/blog
