axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Girish_Kumar" <>
Subject RE: WSS4j with "passwordText" doesn't work
Date Thu, 16 Feb 2006 09:53:44 GMT

How do I unsubscribe from this group? I sent a mail as explained in the
subscription mail. But still I am getting the mails from this group.


-----Original Message-----
From: Ulf Dittmer [] 
Sent: Thursday, February 16, 2006 2:44 PM
Subject: Re: WSS4j with "passwordText" doesn't work


It's a little counter-intuitive, because it works in different ways
depending on whether you use cleartext or digested passwords. I'm
attaching a handler that does both, and which works fine for me.


// the username and password we expect incoming WS calls to use
private String user = "wsuser";
private String pwd = "wspwd";

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];

      if (pc.getUsage() == WSPasswordCallback.USERNAME_TOKEN) {
        // digested password
        if (user.equals(pc.getIdentifer()))
      } else if (pc.getUsage() ==
        // cleartext password
        if (! user.equals(pc.getIdentifer()))
          throw new IOException("unknown user: "+pc.getIdentifer());

        if (! pwd.equals(pc.getPassword()))
          throw new IOException("password incorrect for user:
    } else {
      throw new UnsupportedCallbackException(callbacks[i], "Unrecognized

This email (including any attachments) is intended for the sole use of the intended recipient/s
and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review
or reliance by others or copying or distribution or forwarding of any or all of the contents
in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard is appreciated.

View raw message