src/java.base/share/classes/java/net/Authenticator.java

Print this page




  43  * When authentication is required, the system will invoke one of the
  44  * requestPasswordAuthentication() methods which in turn will call the
  45  * getPasswordAuthentication() method of the registered object.
  46  * <p>
  47  * All methods that request authentication have a default implementation
  48  * that fails.
  49  *
  50  * @see java.net.Authenticator#setDefault(java.net.Authenticator)
  51  * @see java.net.Authenticator#getPasswordAuthentication()
  52  *
  53  * @author  Bill Foote
  54  * @since   1.2
  55  */
  56 
  57 // There are no abstract methods, but to be useful the user must
  58 // subclass.
  59 public abstract
  60 class Authenticator {
  61 
  62     // The system-wide authenticator object.  See setDefault().
  63     private static Authenticator theAuthenticator;
  64 
  65     private String requestingHost;
  66     private InetAddress requestingSite;
  67     private int requestingPort;
  68     private String requestingProtocol;
  69     private String requestingPrompt;
  70     private String requestingScheme;
  71     private URL requestingURL;
  72     private RequestorType requestingAuthType;
  73 
  74     /**
  75      * The type of the entity requesting authentication.
  76      *
  77      * @since 1.5
  78      */
  79     public enum RequestorType {
  80         /**
  81          * Entity requesting authentication is a HTTP proxy server.
  82          */
  83         PROXY,




  43  * When authentication is required, the system will invoke one of the
  44  * requestPasswordAuthentication() methods which in turn will call the
  45  * getPasswordAuthentication() method of the registered object.
  46  * <p>
  47  * All methods that request authentication have a default implementation
  48  * that fails.
  49  *
  50  * @see java.net.Authenticator#setDefault(java.net.Authenticator)
  51  * @see java.net.Authenticator#getPasswordAuthentication()
  52  *
  53  * @author  Bill Foote
  54  * @since   1.2
  55  */
  56 
  57 // There are no abstract methods, but to be useful the user must
  58 // subclass.
  59 public abstract
  60 class Authenticator {
  61 
  62     // The system-wide authenticator object.  See setDefault().
  63     private static volatile Authenticator theAuthenticator;
  64 
  65     private String requestingHost;
  66     private InetAddress requestingSite;
  67     private int requestingPort;
  68     private String requestingProtocol;
  69     private String requestingPrompt;
  70     private String requestingScheme;
  71     private URL requestingURL;
  72     private RequestorType requestingAuthType;
  73 
  74     /**
  75      * The type of the entity requesting authentication.
  76      *
  77      * @since 1.5
  78      */
  79     public enum RequestorType {
  80         /**
  81          * Entity requesting authentication is a HTTP proxy server.
  82          */
  83         PROXY,