Hi Lucaluke, It is possible to get this through the Axis2 message context. Inside Rampart, we add it as a property to message context.
msgCtx.getProperty(RampartMessageData.USERNAME); Thanks. /thilina Thilina Mahesh Buddhika http://blog.thilinamb.com On Wed, Feb 10, 2010 at 1:30 PM, Lucaluke <[email protected]>wrote: > > I am using Axis1.4 > I do have a MessageContext in the PWCallback class and beyond, but no > method > getUserPrincipal, so it must be a different implementation from what you > mention... still in the PWCallback as I am reading the user, I have set it > as a property in the messageContext to make it available for later use. > Another option would be to get the SOAPEnvelope from RequestMessage in the > messageContext and get user and password from there... > > dkulp wrote: > > > > > > You don't mention which webservice stack or anything that you are using. > > > > In general, the "results" vector returned from WSS4J does contain a > > Principal > > object that would hold the username/password stuff. Thus, if that is > > available somehow, that's where you would look. > > > > For CXF, we also map that into the standard JAX-WS > > MessageContext.getUserPrincipal() call making it very easy to get. > > > > Dan > > > > > > On Mon February 8 2010 5:59:17 am Lucaluke wrote: > >> Hi guys, > >> by specifying a soapenv:header in the wsdd file of my web service, I > have > >> managed to validate user name and password passed by the client... > >> > >> The problem now is that later on in the code, I need the username > again, > >> but all I have in the web service implementing classes is the request... > >> which does not contain the header... > >> is there a way to get this info again or to tell wss4j to include it in > >> the > >> request? any suggestions? > >> > >> Thanks > >> > > > > -- > > Daniel Kulp > > [email protected] > > http://www.dankulp.com/blog > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > > > > -- > View this message in context: > http://old.nabble.com/How-do-I-read-WSS-Username-Token-after-validation--tp27498138p27527077.html > Sent from the WSS4J mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
