Class BasicAuthentication<ParameterType,​TokenType>

  • Type Parameters:
    ParameterType - defining the parameter type for the authentication
    TokenType - defining the token type for the authentication
    All Implemented Interfaces:
    Closeable, AutoCloseable, AuthenticationHandler<ParameterType,​TokenType>

    public abstract class BasicAuthentication<ParameterType,​TokenType>
    extends AbstractAuthenticationHandler<ParameterType,​TokenType>
    An abstract implementation of a username-password authentication. It can be given an initial known username-password pair; if so, this will be tried first. Subsequent rounds will then try to obtain a user name and password via the global Authenticator.
    • Field Detail

      • user

        protected String user
        The current user name.
      • password

        protected byte[] password
        The current password.
    • Constructor Detail

      • BasicAuthentication

        public BasicAuthentication​(InetSocketAddress proxy,
                                   String initialUser,
                                   char[] initialPassword)
        Creates a new BasicAuthentication to authenticate with the given proxy.
        Parameters:
        proxy - InetSocketAddress of the proxy to connect to
        initialUser - initial user name to try; may be null
        initialPassword - initial password to try, may be null