Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7170

Support Multiple WWW-Authenticate Headers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.1.8
    • None
    • Transports
    • None
    • Unknown

    Description

      When the authorization type "Digest" is chosen, and the server responds with a 401 and multiple WWW-Authenticate headers, this will most probably lead to an error.

      Define Digest to be your authentication method:
      ...
      AuthorizationPolicy authPolicy = new AuthorizationPolicy();
      authPolicy.setAuthorizationType("Digest");
      ...

      The HTTPConduit will then create a DigestAuthSupplier. In...
      ----------------------------------------------------------
      DigestAuthSupplier.getAuthorization(...) {
      ...
      HttpAuthHeader authHeader = new HttpAuthHeader(fullHeader);
      if (authHeader.authTypeIsDigest()) {
      ...
      }
      }
      ----------------------------------------------------------
      fullHeader will be (because two headers):
      'Basic realm="...", Digest realm="...", nonce="0058a704Y936...", stale=FALSE, qop="auth"'

      the authHeader will have the "Basic", because it is the first in fullHeader. But this does not match of course with authHeader.authTypeIsDigest(), and then it will return null.

      The actual wrong thing is, imo, that the fullHeader is concatenated, instead of choosing the one auth header that matches the method we have defined. Maybe HttpAuthHeader should hold a list of headers instead of concatenating them.

      Furthermore, it would be nice when the suppliers were chosen automatically, based on what authentication methods the server offers.

      Attachments

        Activity

          People

            Unassigned Unassigned
            shollenstein Silvan Hollenstein
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: