Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Relates :
|
Name: rmT116609 Date: 10/22/2003 A DESCRIPTION OF THE REQUEST : Currently, a JVM cam have at most one 'live' Authenticator object at any given time; i.e. the one set using Authenticator.setDefault(). This causes problems in some applications. I propose that a new method be added to the URLConnection API: void setAuthenticator(java.net.Authenticator auth) throws InvalidStateException; This method would allow an application to bind a specific Authenticator to an unconnected URLConnection object to be used instead of the JVM-wide default Authenticator. JUSTIFICATION : This method will make it possible to do a number of things that are otherwise hard to implement in a multi-threaded application. For example, if a URL has a 'userinfo' componenent, the application can create a once-off Authenticator for the URL's username and password and attach it to the URLConnection. It does not need to worrying about interfering with (or leaking passwords to) other threads. (Incident Review ID: 216097) ======================================================================
|