repost: java.net.Authenticator [message #105347] |
Sat, 02 August 2003 06:13 |
Eclipse User |
|
|
|
Hello All,
As you probably know JDK provides one with a possibility to set a callback
object (instace of java.net.Authenticator) that will be called by
HttpURLConnection instance when http server repsponds with a 401
(unauthorized) responce code. Callback object usually should pop-up a login
dialog or somehow fetch user name and password and return it back to the
caller. What is not convinient is that there could be only single instance
of such an object (java.net.Authenticator instance) in run-time.
Eclipse sets such a callback in org.eclipse.update.ui plug-in class
startup() method and provides no means for the user to extend this
callback. This is not very convinient, because plug-ins that would like to
establish authorized http connection depend on org.eclipse.update.ui plug-
in and could not provide custom password fetching code (i.e. if one would
like to pass md5 encoded password). The only option is to set custom
java.net.Authenticator that will either override one set by
org.eclipse.update.ui plug-in or will be overriden at the moment of this
very plug-in activation. Surely, one could force org.eclipse.update.ui
plug-in activation, then set custom authenticator and redirect callback to
the authenticator defined in org.eclipse.update.ui plug-in if required
(i.e., if it is called for the host that should be managed by
org.eclipse.update.ui plug-in). But this looks more as hack than as a
correct way to handle the problem.
Are there any plans to move java.net.Authenticator implementation to one of
the "core" plug-ins (i.e. org.eclipse.core.runtime) and to make it
extensible by other plug-ins through the extenstion point or API? This will
be very convinient for the plug-ins that manages network connections and
would like to have control over authorization process.
--
best regards,
alexander kitaev
|
|
|
Powered by
FUDForum. Page generated in 0.02683 seconds