Hi Rampart Devs,

Is it possible to use signature, encryption and authentication with
rampart, using the same callback handler ?

I also want to use different usernames and passwords for UsernameToken
and Signature.

This is related to :

https://issues.apache.org/jira/browse/RAMPART-27

but i would also want to manipulate different passwords for username
and signature, using the same PWCBHandler.

For example, in the handler of the UsernameToken example (sample01), I have:

       for (int i = 0; i < callbacks.length; i++) {

           //When the server side need to authenticate the user
           WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
           if (pwcb.getUsage() == WSPasswordCallback.USERNAME_TOKEN_UNKNOWN) {
               if(pwcb.getIdentifer().equals("alice") &&
pwcb.getPassword().equals("bobPW")) {
                   return;
               } else {
                   throw new
UnsupportedCallbackException(callbacks[i], "check failed");
               }
           }

           //When the client requests for the password to be added in to the
           //UT element
           pwcb.setPassword("bobPW");

====

while, in the handler of the Signature and Encryption example
(sample03) , I have:

    for (int i = 0; i < callbacks.length; i++) {
           WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
           String id = pwcb.getIdentifer();
           if("client".equals(id)) {
               pwcb.setPassword("apache");
           } else if("service".equals(id)) {
               pwcb.setPassword("apache");
           }

====

How can this be combined? Thanks very much in advance.


Regards,
Angel

Reply via email to