Class NTLMScheme
- java.lang.Object
-
- org.apache.commons.httpclient.auth.NTLMScheme
-
- All Implemented Interfaces:
AuthScheme
@Deprecated public class NTLMScheme extends java.lang.Object implements AuthScheme
Deprecated.Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project. It is not recommended to use it in any new code. Instead, use HTTP client API plugins as a dependency in your code. E.g. Apache HttpComponents Client API 4.x Plugin or Async HTTP Client Plugin.An implementation of the Microsoft proprietary NTLM authentication scheme. For a detailed explanation of the NTLM scheme please see http://davenport.sourceforge.net/ntlm.html.
-
-
Constructor Summary
Constructors Constructor Description NTLMScheme()
Deprecated.Default constructor for the NTLM authentication scheme.NTLMScheme(java.lang.String challenge)
Deprecated.Constructor for the NTLM authentication scheme.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
authenticate(Credentials credentials, java.lang.String method, java.lang.String uri)
Deprecated.java.lang.String
authenticate(Credentials credentials, HttpMethod method)
Deprecated.Produces NTLM authorization string for the given set ofCredentials
.static java.lang.String
authenticate(NTCredentials credentials, java.lang.String challenge)
Deprecated.Use non-staticauthenticate(Credentials, HttpMethod)
static java.lang.String
authenticate(NTCredentials credentials, java.lang.String challenge, java.lang.String charset)
Deprecated.Use non-staticauthenticate(Credentials, HttpMethod)
java.lang.String
getID()
Deprecated.no longer usedjava.lang.String
getParameter(java.lang.String name)
Deprecated.Returns the authentication parameter with the given name, if available.java.lang.String
getRealm()
Deprecated.The concept of an authentication realm is not supported by the NTLM authentication scheme.java.lang.String
getSchemeName()
Deprecated.Returns textual designation of the NTLM authentication scheme.boolean
isComplete()
Deprecated.Tests if the NTLM authentication process has been completed.boolean
isConnectionBased()
Deprecated.Returns true.void
processChallenge(java.lang.String challenge)
Deprecated.Processes the NTLM challenge.
-
-
-
Constructor Detail
-
NTLMScheme
public NTLMScheme()
Deprecated.Default constructor for the NTLM authentication scheme.- Since:
- 3.0
-
NTLMScheme
public NTLMScheme(java.lang.String challenge) throws MalformedChallengeException
Deprecated.Constructor for the NTLM authentication scheme.- Parameters:
challenge
- The authentication challenge- Throws:
MalformedChallengeException
- is thrown if the authentication challenge is malformed
-
-
Method Detail
-
processChallenge
public void processChallenge(java.lang.String challenge) throws MalformedChallengeException
Deprecated.Processes the NTLM challenge.- Specified by:
processChallenge
in interfaceAuthScheme
- Parameters:
challenge
- the challenge string- Throws:
MalformedChallengeException
- is thrown if the authentication challenge is malformed- Since:
- 3.0
-
isComplete
public boolean isComplete()
Deprecated.Tests if the NTLM authentication process has been completed.- Specified by:
isComplete
in interfaceAuthScheme
- Returns:
- true if Basic authorization has been processed, false otherwise.
- Since:
- 3.0
-
getSchemeName
public java.lang.String getSchemeName()
Deprecated.Returns textual designation of the NTLM authentication scheme.- Specified by:
getSchemeName
in interfaceAuthScheme
- Returns:
ntlm
-
getRealm
public java.lang.String getRealm()
Deprecated.The concept of an authentication realm is not supported by the NTLM authentication scheme. Always returnsnull
.- Specified by:
getRealm
in interfaceAuthScheme
- Returns:
null
-
getID
public java.lang.String getID()
Deprecated.no longer usedReturns a String identifying the authentication challenge. This is used, in combination with the host and port to determine if authorization has already been attempted or not. Schemes which require multiple requests to complete the authentication should return a different value for each stage in the request.Additionally, the ID should take into account any changes to the authentication challenge and return a different value when appropriate. For example when the realm changes in basic authentication it should be considered a different authentication attempt and a different value should be returned.
- Specified by:
getID
in interfaceAuthScheme
- Returns:
- String a String identifying the authentication challenge. The returned value may be null.
-
getParameter
public java.lang.String getParameter(java.lang.String name)
Deprecated.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 interfaceAuthScheme
- Parameters:
name
- The name of the parameter to be returned- Returns:
- the parameter with the given name
-
isConnectionBased
public boolean isConnectionBased()
Deprecated.Returns true. NTLM authentication scheme is connection based.- Specified by:
isConnectionBased
in interfaceAuthScheme
- Returns:
- true.
- Since:
- 3.0
-
authenticate
public static java.lang.String authenticate(NTCredentials credentials, java.lang.String challenge) throws AuthenticationException
Deprecated.Use non-staticauthenticate(Credentials, HttpMethod)
Create a NTLM authorization string for the given challenge and NT credentials.- Parameters:
challenge
- The challenge.credentials
-NTCredentials
- Returns:
- a ntlm authorization string
- Throws:
AuthenticationException
- is thrown if authentication fails
-
authenticate
public static java.lang.String authenticate(NTCredentials credentials, java.lang.String challenge, java.lang.String charset) throws AuthenticationException
Deprecated.Use non-staticauthenticate(Credentials, HttpMethod)
Create a NTLM authorization string for the given challenge and NT credentials.- Parameters:
challenge
- The challenge.credentials
-NTCredentials
charset
- The charset to use for encoding the credentials- Returns:
- a ntlm authorization string
- Throws:
AuthenticationException
- is thrown if authentication fails- Since:
- 3.0
-
authenticate
public java.lang.String authenticate(Credentials credentials, java.lang.String method, java.lang.String uri) throws AuthenticationException
Deprecated.Produces NTLM authorization string for the given set ofCredentials
.- Specified by:
authenticate
in interfaceAuthScheme
- Parameters:
credentials
- The set of credentials to be used for athenticationmethod
- Method name is ignored by the NTLM authentication schemeuri
- URI is ignored by the NTLM authentication scheme- Returns:
- an NTLM authorization string
- Throws:
InvalidCredentialsException
- if authentication credentials are not valid or not applicable for this authentication schemeAuthenticationException
- if authorization string cannot be generated due to an authentication failure- See Also:
HttpMethod.getName()
,HttpMethod.getPath()
-
authenticate
public java.lang.String authenticate(Credentials credentials, HttpMethod method) throws AuthenticationException
Deprecated.Produces NTLM authorization string for the given set ofCredentials
.- Specified by:
authenticate
in interfaceAuthScheme
- Parameters:
credentials
- The set of credentials to be used for athenticationmethod
- The method being authenticated- Returns:
- an NTLM authorization string
- Throws:
InvalidCredentialsException
- if authentication credentials are not valid or not applicable for this authentication schemeAuthenticationException
- if authorization string cannot be generated due to an authentication failure- Since:
- 3.0
-
-