Class BasicScheme

    • Field Detail

      • complete

        private boolean complete
        Whether the basic authentication process is complete
    • Constructor Detail

      • BasicScheme

        public BasicScheme​(java.nio.charset.Charset credentialsCharset)
        Since:
        4.3
      • BasicScheme

        @Deprecated
        public BasicScheme​(ChallengeState challengeState)
        Deprecated.
        (4.3) do not use.
        Creates an instance of BasicScheme with the given challenge state.
        Since:
        4.2
      • BasicScheme

        public BasicScheme()
    • Method Detail

      • getSchemeName

        public java.lang.String getSchemeName()
        Returns textual designation of the basic authentication scheme.
        Returns:
        basic
      • isComplete

        public boolean isComplete()
        Tests if the Basic authentication process has been completed.
        Returns:
        true if Basic authorization has been processed, false otherwise.
      • isConnectionBased

        public boolean isConnectionBased()
        Returns false. Basic authentication scheme is request based.
        Returns:
        false.
      • authenticate

        public org.apache.http.Header authenticate​(Credentials credentials,
                                                   org.apache.http.HttpRequest request,
                                                   org.apache.http.protocol.HttpContext context)
                                            throws AuthenticationException
        Produces basic authorization header for the given set of Credentials.
        Specified by:
        authenticate in interface ContextAwareAuthScheme
        Overrides:
        authenticate in class AuthSchemeBase
        Parameters:
        credentials - The set of credentials to be used for authentication
        request - The request being authenticated
        context - HTTP context
        Returns:
        a basic authorization string
        Throws:
        InvalidCredentialsException - if authentication credentials are not valid or not applicable for this authentication scheme
        AuthenticationException - if authorization string cannot be generated due to an authentication failure
      • authenticate

        @Deprecated
        public static org.apache.http.Header authenticate​(Credentials credentials,
                                                          java.lang.String charset,
                                                          boolean proxy)
        Returns a basic Authorization header value for the given Credentials and charset.
        Parameters:
        credentials - The credentials to encode.
        charset - The charset to use for encoding the credentials
        Returns:
        a basic authorization header