aspose file tools*
The moose likes Web Services and the fly likes Username Token in J2EE App Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Username Token in J2EE App" Watch "Username Token in J2EE App" New topic
Author

Username Token in J2EE App

Andy Weiss
Greenhorn

Joined: Dec 06, 2005
Posts: 2
Running Websphere v6.0. I have a webservice coded and running. It requires a Username token.

I made a .NET client that sends the Username token. All works great.

I need to write a J2EE client that sends the Username token. When I follow the documentation to create a token generator in the client, I get to choose between:

NonPromptCallbackHandler
GUIPromptCallbackHandler
X509CallbackHandler
PKIPathCallbackHandler
PKCS7CallbackHandler
LTPATokenCallbackHandler
StdinPromptCallbackHandler

But none of those suit my needs! I need to programmatically specify the username and password. None of those allow me to write my OWN CODE to specify the username and password!

Can anyone help me?
Andy
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42912
    
  68
Which client libraray are you using? WSS4J has the org.apache.ws.security.WSPasswordCallback for this purpose, but it doesn't have any of the ones you mention, so that's probably not what you're using.
Andy Weiss
Greenhorn

Joined: Dec 06, 2005
Posts: 2
I'm running all IBM WAS libraries. I haven't had to import any third-party libraries. It all supposedly comes with IBM WAS.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42912
    
  68
A bit of googling in IBMs documentation suggests that you need to use javax.security.auth.callback.NameCallback. Poke around here, and you may find what you're looking for. I've never used WebSphere, so this is part guessing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Username Token in J2EE App