wood burning stoves 2.0*
The moose likes Web Services and the fly likes Custom UsernameToken? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Custom UsernameToken?" Watch "Custom UsernameToken?" New topic
Author

Custom UsernameToken?

Justin Olomar
Greenhorn

Joined: Sep 08, 2009
Posts: 10
We would like to use the UsernameToken WS-Security standard to implement security in our web services. The only hitch is that we need more than just a username and password...we need a CompanyID, also. Is it possible to create a custom UsernameToken element in the SOAP headers and still be compliant with the WS-Security standards? I apologize if I have not used the correct terminology...hopefully this makes sense.

We are using Tomcat 6, Axis2 v1.5 and Rampart. As an example, we would like the header to look something like this:

Thank you,
Justin
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41587
    
  54
No, I don't think that's allowed. But nothing stops you from adding your own custom SOAP header that's outside of the wsse:Security header.


Ping & DNS - my free Android networking tools app
Justin Olomar
Greenhorn

Joined: Sep 08, 2009
Posts: 10
Ulf Dittmer wrote:No, I don't think that's allowed. But nothing stops you from adding your own custom SOAP header that's outside of the wsse:Security header.
Thank you for the reply. So if we add our own custom headers to accomplish what we want, will our web service still be SOAP compliant and be able to be easily accessed via Java OR .NET clients? (If you can't tell, I'm new to this sort of thing )
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41587
    
  54
SOAP specifically allows adding custom headers; you may want to read through the SOAP spec for the details - it's not long or complicated.
Justin Olomar
Greenhorn

Joined: Sep 08, 2009
Posts: 10
Ulf Dittmer wrote:SOAP specifically allows adding custom headers; you may want to read through the SOAP spec for the details - it's not long or complicated.
Thanks Ulf, you've pointed me in the right direction....hopefully.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Custom UsernameToken?