Uploaded image for project: 'WSS4J'
  1. WSS4J
  2. WSS-636

CLONE - Password set to null in UsernameTokenValidator

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: WSS4J Core
    • Environment:
      linux, cxf, jetty 6.10

      Description

      When trying to do basic authentication in Soap header with UserNameToken, token is well read from XML, but badly passed to password callback.
      Line 165 of org.apache.ws.security.validate.UsernameTokenValidator :

      WSPasswordCallback pwCb =
      new WSPasswordCallback(user, null, pwType, WSPasswordCallback.USERNAME_TOKEN, data);

      The password is set to null, while it has been correcty read just before.
      Proposed patch :

      Index: src/main/java/org/apache/ws/security/validate/UsernameTokenValidator.java
      ===================================================================
      — src/main/java/org/apache/ws/security/validate/UsernameTokenValidator.java (rĂ©vision 1098991)
      +++ src/main/java/org/apache/ws/security/validate/UsernameTokenValidator.java (copie de travail)
      @@ -163,7 +163,7 @@
      boolean passwordsAreEncoded = usernameToken.getPasswordsAreEncoded();

      WSPasswordCallback pwCb =

      • new WSPasswordCallback(user, null, pwType, WSPasswordCallback.USERNAME_TOKEN, data);
        + new WSPasswordCallback(user, password, pwType, WSPasswordCallback.USERNAME_TOKEN, data);
        try
        Unknown macro: { data.getCallbackHandler().handle(new Callback[]{pwCb}); }

        catch (IOException e) {

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                coheigea Colm O hEigeartaigh
                Reporter:
                B.deVries Bouke
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: