Package org.jsoup.helper
Class AuthenticationHandler
java.lang.Object
java.net.Authenticator
org.jsoup.helper.AuthenticationHandler
Handles per request Authenticator-based authentication. Loads the class `org.jsoup.helper.RequestAuthHandler` if
per-request Authenticators are supported (Java 9+), or installs a system-wide Authenticator that delegates to a request
ThreadLocal.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface
(package private) static class
On Java 8 we install a system-wide Authenticator, which pulls the delegating Auth from a ThreadLocal pool.Nested classes/interfaces inherited from class java.net.Authenticator
Authenticator.RequestorType
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int
(package private) RequestAuthenticator
(package private) static AuthenticationHandler.AuthShim
(package private) static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal PasswordAuthentication
Authentication callback, called by HttpURLConnection - either as system-wide default (Java 8) or per HttpURLConnection (Java 9+)Methods inherited from class java.net.Authenticator
getDefault, getRequestingHost, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingScheme, getRequestingSite, getRequestingURL, getRequestorType, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthenticationInstance, setDefault
-
Field Details
-
MaxAttempts
static final int MaxAttempts- See Also:
-
handler
-
auth
RequestAuthenticator auth -
attemptCount
int attemptCount
-
-
Constructor Details
-
AuthenticationHandler
AuthenticationHandler() -
AuthenticationHandler
AuthenticationHandler(RequestAuthenticator auth)
-
-
Method Details
-
getPasswordAuthentication
Authentication callback, called by HttpURLConnection - either as system-wide default (Java 8) or per HttpURLConnection (Java 9+)- Overrides:
getPasswordAuthentication
in classAuthenticator
- Returns:
- credentials, or null if not attempting to auth.
-