Posted By:
Anonymous
Posted On:
Thursday, September 8, 2005 06:49 AM
I have an axis webservice which requires client to send username/password tokens for authentication. my server does the "authentication" with no problem (match client's username and password with server's password). I have many users (that means many clients with different usernames and passwords) when the user calls one of my allowed methods I want to know which user called that method. I would appreciate if you help me finding out which "client"(user) is calling the allowed method. I use wss4j to process username/password tokens. In my wssd file I have following to show where my password checking will take place:
More>>
I have an axis webservice which requires client to send username/password tokens for authentication. my server
does the "authentication" with no problem (match client's username and password with server's password).
I have many users (that means many clients with different usernames and passwords) when the user calls
one of my allowed methods I want to know which user called that method.
I would appreciate if you help me finding out which "client"(user) is calling the allowed method.
I use wss4j to process username/password tokens.
In my wssd file I have following to show where my password checking will take place:
In my Callnack class com.alex.ws.callback.PWCallback I have:
public void handle(Callback[] callbacks)
throws IOException, UnsupportedCallbackException {
for (int i = 0; i
< callbacks.length; i++) {
System.out.println("1");
if (callbacks[i] instanceof WSPasswordCallback) {
WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
if (pc.getUsage() == WSPasswordCallback.KEY_NAME) {
pc.setKey(key);
} else {
pc.setPassword(UserStore.getPassword(pc.getIdentifer()));
}
} else {
throw new UnsupportedCallbackException(callbacks[i],
"Unrecognized Callback");
}
}
}
When the user sends SOAP message with Username/Password token
PWCallback class works fine and authentication is done with no problem.
One of my allowed method is :
public String doIt(String msg)
{
System.out.println("Here is the message:"+msg);
String username= "";
//some code to find the username
//of the sender. Please help me in here
System.out.println("Here is the username that sent the msg:"+username);
}
Can you help me to find out how I can find out the "username" of client within the allowed method.
<<Less