public class HttpAuthenticator extends Authenticator
When we try to access a protected site,
getPasswordAuthentication() is called by the network
connection code (HttpURLConnection in our case) to obtain
any credentials (username and password) required to access the site.
Note: This only occurs until we successfully "log in" - after that, we are not invoked again for the site in question.
Authenticator.RequestorType| Constructor and Description |
|---|
HttpAuthenticator() |
| Modifier and Type | Method and Description |
|---|---|
protected PasswordAuthentication |
getPasswordAuthentication()
Override the default implementation to provide the credentials required
for our network authentication
|
void |
setCredentials(String realm,
String username,
String password)
Establish realm login credentials
|
getRequestingHost, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingScheme, getRequestingSite, getRequestingURL, getRequestorType, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, setDefaultpublic void setCredentials(String realm, String username, String password)
realm - Realm for authentication (ADS)username - User for loginpassword - Passwordprotected PasswordAuthentication getPasswordAuthentication()
getPasswordAuthentication in class AuthenticatorCopyright © 2004–2017 Indiana University Library Information Technology. All rights reserved.