Class DefaultAuthenticator


  • public final class DefaultAuthenticator
    extends java.net.Authenticator
    This is the default authenticator used in JOSM. It delegates lookup of credentials for the OSM API and an optional proxy server to the currently configured CredentialsManager.
    Since:
    2641
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.net.Authenticator

        java.net.Authenticator.RequestorType
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean addFailedCredentialHost​(java.lang.String host)
      Marks for this host that the authentication failed, i.e., the CredentialsManager will show a dialog at the next time.
      static DefaultAuthenticator getInstance()
      Returns the unique instance
      protected java.net.PasswordAuthentication getPasswordAuthentication()
      Called by the Java HTTP stack when either the OSM API server or a proxy requires authentication.
      boolean isEnabled()
      Determines whether this authenticator is enabled, i.e., provides password authentication via CredentialsManager.
      boolean removeFailedCredentialHost​(java.lang.String host)
      Un-marks the failed authentication attempt for the host
      void setEnabled​(boolean enabled)
      Enabled/disables this authenticator, i.e., decides whether it should provide password authentication via CredentialsManager.
      • 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
    • Method Detail

      • getPasswordAuthentication

        protected java.net.PasswordAuthentication getPasswordAuthentication()
        Called by the Java HTTP stack when either the OSM API server or a proxy requires authentication.
        Overrides:
        getPasswordAuthentication in class java.net.Authenticator
      • addFailedCredentialHost

        public boolean addFailedCredentialHost​(java.lang.String host)
        Marks for this host that the authentication failed, i.e., the CredentialsManager will show a dialog at the next time.
        Parameters:
        host - the host to mark
        Returns:
        as per Collection.add(Object)
      • removeFailedCredentialHost

        public boolean removeFailedCredentialHost​(java.lang.String host)
        Un-marks the failed authentication attempt for the host
        Parameters:
        host - the host to un-mark
        Returns:
        as per Collection.remove(Object)