• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Username Token in J2EE App

 
Andy Weiss
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic