JDK-8169495 : Add a method to set an Authenticator on a HttpURLConnection.
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-11-09
  • Updated: 2021-09-22
  • Resolved: 2016-12-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b148Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
With today API, it is not possible to login to the same web site/server through HTTP with different credentials. This is because HttpURLConnection will always use the default Authenticator, which is global.

Adding a new HttpURLConnection::setAuthenticator method would help solve this issue.

For compatibility reasons, an HttpURLConnection on which no authenticator was explicitly set should continue using the default authenticator. 
Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/bc6c31fd98cf User: lana Date: 2016-12-07 19:33:44 +0000
07-12-2016

URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/bc6c31fd98cf User: dfuchs Date: 2016-12-02 13:19:53 +0000
02-12-2016

FC Extension Request Here is a webrev of the proposed changes: http://cr.openjdk.java.net/~dfuchs/webrev_8169495/webrev.00/ This RFE has been requested several times in the past and yet again recently. The work is done - the public review process is started, but CCC will be required before integration. Estimated integration date in 9/dev should be ~ Nov 25th ~ Dec 1st, depending on how fast the reviews are going.
11-11-2016