Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8326949 Authorization header is removed when a proxy Authenticator is set on HttpClient
  3. JDK-8341948

Release Note: Authenticator No Longer Overwrites User Set Authorization Headers

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Delivered
    • Icon: P4 P4
    • 24
    • 24
    • core-libs

      Prior to JDK 24, if a `java.net.Authenticator` is set on a `HttpClient`, then any user set `Authorization` or `Proxy-Authorization` headers will be removed or overwritten by values generated by the client library. From JDK 24, if such headers are set by the user, then they will be left in place and the authenticator will not be invoked for the respective header. In particular, if the authentication fails for the provided header, the failed response with the 401 0r 407 status code will be returned directly to the calling code. One use case for this could be to let the authenticator handle proxy authentication and for the user to set the `Authorization` headers for the server.

            michaelm Michael McMahon
            michaelm Michael McMahon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: