File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Murach's Java Servlets and JSP this week in the Servlets 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: 41052
    
  43
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.


Ping & DNS - my free Android networking tools app
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: 41052
    
  43
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.
 
 
subject: Username Token in J2EE App
 
Similar Threads
IBM HttpServer and websphere Appserver
Problem running MySql
How to create UsernameToken in Java WS client to compatble with .Net (.asmx) web service
digest authentication on client side implementation.
Implementing Access Rights on Axis2 Web Service?