Hi, Interesting ... could this be the case that initUserManagementPort() is called multiple times with different user contexts?
Regards, Andrei. > -----Original Message----- > From: patch_78 [mailto:[email protected]] > Sent: Mittwoch, 27. August 2014 21:20 > To: [email protected] > Subject: Two wsse:UsernameToken in a request with different wsse:Username > > Hi, > > I do not understand why my soap request to web service containing two > wsse:UsernameToken with different wsse:Username as below. The > "[email protected]" > is the first user who login, while the "[email protected]" is the current user > > <wsse:UsernameToken wsu:Id="UsernameToken- > 2094ECD36680474492140916671301035" > xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- > wssecurity-secext-1.0.xsd" > xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- > wssecurity-utility-1.0.xsd"> > <wsse:Username>[email protected]</wsse:Username> > <wsse:Password > Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username- > token-profile-1.0#PasswordText">liO&%KL</wsse:Password> > </wsse:UsernameToken> > <wsse:UsernameToken > wsu:Id="UsernameToken-3A2F8DC1BC22CCE9451409166713057101"> > <wsse:Username>[email protected]</wsse:Username> > <wsse:Password > Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username- > token-profile-1.0#PasswordText">liO&%KL</wsse:Password> > </wsse:UsernameToken> > > This is code where I add wsse:UsernameToken into the request. > > private void initUserManagementPort() { > String username = getUserSession().getUserName(); // get the value > for <wsse:Username> > service = new UserManagementService(); > port = service.getUserManagementPort(); > > Map ctx = ((BindingProvider) port).getRequestContext(); > ctx.put("ws-security.username", username); > ctx.put("ws-security.callback-handler", > ClientCallbackHandler.class.getName()); > > } > > > > > -- > View this message in context: http://cxf.547215.n5.nabble.com/Two-wsse- > UsernameToken-in-a-request-with-different-wsse-Username-tp5748229.html > Sent from the cxf-user mailing list archive at Nabble.com.
