Class CustomNTLMAuthScheme

  • All Implemented Interfaces:
    org.apache.commons.httpclient.auth.AuthScheme
    Direct Known Subclasses:
    CustomNTLMV1AuthScheme, CustomNTLMV2AuthScheme

    public abstract class CustomNTLMAuthScheme
    extends Object
    implements org.apache.commons.httpclient.auth.AuthScheme
    Custom NTLM Authentication Scheme.
    • Constructor Detail

      • CustomNTLMAuthScheme

        public CustomNTLMAuthScheme()
        Default constructor for the NTLM authentication scheme.
        Since:
        3.0
      • CustomNTLMAuthScheme

        public CustomNTLMAuthScheme​(String challenge)
                             throws org.apache.commons.httpclient.auth.MalformedChallengeException
        Constructor for the NTLM authentication scheme.
        Parameters:
        challenge - The authentication challenge
        Throws:
        org.apache.commons.httpclient.auth.MalformedChallengeException - is thrown if the authentication challenge is malformed
    • Method Detail

      • processChallenge

        public void processChallenge​(String challenge)
                              throws org.apache.commons.httpclient.auth.MalformedChallengeException
        Processes the NTLM challenge.
        Specified by:
        processChallenge in interface org.apache.commons.httpclient.auth.AuthScheme
        Parameters:
        challenge - the challenge string
        Throws:
        org.apache.commons.httpclient.auth.MalformedChallengeException - is thrown if the authentication challenge is malformed
        Since:
        3.0
      • isComplete

        public boolean isComplete()
        Tests if the NTLM authentication process has been completed.
        Specified by:
        isComplete in interface org.apache.commons.httpclient.auth.AuthScheme
        Returns:
        true if Basic authorization has been processed, false otherwise.
        Since:
        3.0
      • getSchemeName

        public String getSchemeName()
        Returns textual designation of the NTLM authentication scheme.
        Specified by:
        getSchemeName in interface org.apache.commons.httpclient.auth.AuthScheme
        Returns:
        ntlm
      • getRealm

        public String getRealm()
        The concept of an authentication realm is not supported by the NTLM authentication scheme. Always returns null.
        Specified by:
        getRealm in interface org.apache.commons.httpclient.auth.AuthScheme
        Returns:
        null
      • getID

        public String getID()
        Unsupported.
        Specified by:
        getID in interface org.apache.commons.httpclient.auth.AuthScheme
      • getParameter

        public String getParameter​(String name)
        Returns the authentication parameter with the given name, if available.

        There are no valid parameters for NTLM authentication so this method always returns null.

        Specified by:
        getParameter in interface org.apache.commons.httpclient.auth.AuthScheme
        Parameters:
        name - The name of the parameter to be returned
        Returns:
        the parameter with the given name
      • isConnectionBased

        public boolean isConnectionBased()
        Returns true. NTLM authentication scheme is connection based.
        Specified by:
        isConnectionBased in interface org.apache.commons.httpclient.auth.AuthScheme
        Returns:
        true.
        Since:
        3.0
      • authenticate

        public static String authenticate​(org.apache.commons.httpclient.NTCredentials credentials,
                                          String challenge)
                                   throws org.apache.commons.httpclient.auth.AuthenticationException
        Unsupported.
        Throws:
        org.apache.commons.httpclient.auth.AuthenticationException
      • authenticate

        public static String authenticate​(org.apache.commons.httpclient.NTCredentials credentials,
                                          String challenge,
                                          String charset)
                                   throws org.apache.commons.httpclient.auth.AuthenticationException
        Unsupported.
        Throws:
        org.apache.commons.httpclient.auth.AuthenticationException
      • getNTLMVersion

        public abstract String getNTLMVersion()
        Unsupported.
      • authenticate

        public String authenticate​(org.apache.commons.httpclient.Credentials credentials,
                                   String method,
                                   String uri)
                            throws org.apache.commons.httpclient.auth.AuthenticationException
        Unsupported.
        Specified by:
        authenticate in interface org.apache.commons.httpclient.auth.AuthScheme
        Throws:
        org.apache.commons.httpclient.auth.AuthenticationException
      • authenticate

        public String authenticate​(org.apache.commons.httpclient.Credentials credentials,
                                   org.apache.commons.httpclient.HttpMethod method)
                            throws org.apache.commons.httpclient.auth.AuthenticationException
        Produces NTLM authorization string for the given set of Credentials.
        Specified by:
        authenticate in interface org.apache.commons.httpclient.auth.AuthScheme
        Parameters:
        credentials - The set of credentials to be used for athentication
        method - The method being authenticated
        Returns:
        an NTLM authorization string
        Throws:
        org.apache.commons.httpclient.auth.InvalidCredentialsException - if authentication credentials are not valid or not applicable for this authentication scheme
        org.apache.commons.httpclient.auth.AuthenticationException - if authorization string cannot be generated due to an authentication failure
        Since:
        3.0