public class PropertyAuthenticator extends Authenticator
installInstance(boolean) is provided to set this
authenticator up for use in all HTTP connection attempts.
Since this uses the same username and password for all web sites, it's obviously a bit of a blunt instrument. It may be refined at some point in the future.
Authenticator.RequestorType| Modifier and Type | Field and Description |
|---|---|
static String |
PASSWORD_PROP
System property supplying basic authentication password ("star.basicauth.password").
|
static String |
USER_PROP
System property supplying basic authentication username ("star.basicauth.user").
|
| Constructor and Description |
|---|
PropertyAuthenticator()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static PasswordAuthentication |
createAuthentication()
Returns a PasswordAuthentication instance suitable for use with
PropertyAuthenticator.
|
PasswordAuthentication |
getPasswordAuthentication() |
static boolean |
installInstance(boolean offerAdvice)
Installs an instance of PropertyAuthenticator so that it is used
automatically in response to all 401 Unauthorized HTTP responses.
|
getRequestingHost, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingScheme, getRequestingSite, getRequestingURL, getRequestorType, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, setDefaultpublic static final String USER_PROP
public static final String PASSWORD_PROP
public PasswordAuthentication getPasswordAuthentication()
getPasswordAuthentication in class Authenticatorpublic static PasswordAuthentication createAuthentication()
public static boolean installInstance(boolean offerAdvice)
offerAdvice parameter is true, then if
the properties are not set up, an authenticator is installed which
issues a message advising how to use system properties to get
the authenticator working next time.offerAdvice - if true, install an advising authenticator if the
property one isn't going to workofferAdvice is true, will always return trueAuthenticator.setDefault(java.net.Authenticator)Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.