Package org.jsoup.helper
Class AuthenticationHandler
- java.lang.Object
-
- java.net.Authenticator
-
- org.jsoup.helper.AuthenticationHandler
-
class AuthenticationHandler extends java.net.Authenticator
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 Classes Modifier and Type Class Description (package private) static interface
AuthenticationHandler.AuthShim
(package private) static class
AuthenticationHandler.GlobalHandler
On Java 8 we install a system-wide Authenticator, which pulls the delegating Auth from a ThreadLocal pool.
-
Field Summary
Fields Modifier and Type Field Description (package private) int
attemptCount
(package private) RequestAuthenticator
auth
(package private) static AuthenticationHandler.AuthShim
handler
(package private) static int
MaxAttempts
-
Constructor Summary
Constructors Constructor Description AuthenticationHandler()
AuthenticationHandler(RequestAuthenticator auth)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.PasswordAuthentication
getPasswordAuthentication()
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 Detail
-
MaxAttempts
static final int MaxAttempts
- See Also:
- Constant Field Values
-
handler
static AuthenticationHandler.AuthShim handler
-
auth
RequestAuthenticator auth
-
attemptCount
int attemptCount
-
-
Constructor Detail
-
AuthenticationHandler
AuthenticationHandler()
-
AuthenticationHandler
AuthenticationHandler(RequestAuthenticator auth)
-
-
Method Detail
-
getPasswordAuthentication
public final java.net.PasswordAuthentication getPasswordAuthentication()
Authentication callback, called by HttpURLConnection - either as system-wide default (Java 8) or per HttpURLConnection (Java 9+)- Overrides:
getPasswordAuthentication
in classjava.net.Authenticator
- Returns:
- credentials, or null if not attempting to auth.
-
-