Class 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.
      • Nested classes/interfaces inherited from class java.net.Authenticator

        java.net.Authenticator.RequestorType
    • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AuthenticationHandler

        AuthenticationHandler()
    • 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 class java.net.Authenticator
        Returns:
        credentials, or null if not attempting to auth.