Hi,

Your callback handler implementation must provide passwords for those
user you specify in the configuration. Both classes that you have
implemented sets the passwords for the user called "wss4j" only.
Looking at the exception you will have to set the password for the
user "secureserver" in the callback handler.

Thanks,
Ruchith

On 9/11/06, Luca Risello <[EMAIL PROTECTED]> wrote:

Hi Anastasia,

I think this is my last problem to fix to reach my goal!!!!!

"Be sure to add the right passwords in your password callback class...
Good luck"

I've added the usernamen and the password of the client_keystore in the
client side PWCallaback.class but this is the exception:

General security error (WSSecurityEngine: Callback supplied no password for:
secureserver)


secureserver is the alias of the srver_keystore but there are some problems.

PWCallback (client)

package prova.client;

import java.io.IOException;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import
javax.security.auth.callback.UnsupportedCallbackException;
import org.apache.ws.security.WSPasswordCallback;
_/**
 * PWCallback for the Client
 */
public class PWCallback implements CallbackHandler {
 _/**
  * @see
javax.security.auth.callback.CallbackHandler#handle(javax.security.auth.callback.Callback[])
  */
 public void handle(Callback[] callbacks) throws IOException,
   UnsupportedCallbackException {
  for (int i = 0; i < callbacks.length; i++) {
   if (callbacks[i] instanceof WSPasswordCallback) {
    WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
    // set the password given a username
    if ("wss4j".equals(pc.getIdentifer())) {
     pc.setPassword("security");
    }
   } else {
    throw new UnsupportedCallbackException(callbacks[i],
      "Unrecognized Callback");
   }
  }
 }
}

PWCallback (server)

import java.io.IOException;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import
javax.security.auth.callback.UnsupportedCallbackException;
import org.apache.ws.security.WSPasswordCallback;
public class PWCallback implements CallbackHandler {
    public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
        for (int i = 0; i < callbacks.length; i++) {
            if (callbacks[i] instanceof WSPasswordCallback) {
                WSPasswordCallback pc =
(WSPasswordCallback)callbacks[i];
                // set the password given a username
                if ("wss4j".equals(pc.getIdentifer())) {
                    pc.setPassword("changeit");
                }
            } else {
                throw new
UnsupportedCallbackException(callbacks[i], "Unrecognized
Callback");
            }
        }
    }
}


Thanks for the reply!




 __________________________________________________
Do You Yahoo!?
Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto
spazio gratuito per i tuoi file e i messaggi
http://mail.yahoo.it


--
www.ruchith.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to