RFR: 8169495: Add a method to set an Authenticator on a HttpURLConnection. (original) (raw)

Daniel Fuchs daniel.fuchs at oracle.com
Thu Nov 10 15:12:38 UTC 2016


Hi,

Please find below a patch for:

https://bugs.openjdk.java.net/browse/JDK-8169495 8169495: Add a method to set an Authenticator on a HttpURLConnection.

webrev: http://cr.openjdk.java.net/~dfuchs/webrev_8169495/webrev.00

The public API changes are in java.net.HttpURLConnection and java.net.Authenticator. For backward compatibility reason the new HttpURLConnection::setAuthenticator method is not abstract, but is instead implemented to throw UOE unless overridden.

Again for compatibility reasons, if no authenticator is explicitly supplied to the connection then the behavior is unchanged: the default authenticator will be invoked, if needed, at the time credentials are requested through the HTTP protocol.

Here is the description of the new HttpURLConnection::setAuthenticator method:

  /**

invoke the

information,

HttpURLConnection}

Authenticator is

connected.

{@code null}.

authenticator"

best regards,

-- daniel



More information about the core-libs-dev mailing list