Package org.apache.synapse.util
Class CustomNTLMAuthScheme
- java.lang.Object
-
- org.apache.synapse.util.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 Summary
Constructors Constructor Description CustomNTLMAuthScheme()
Default constructor for the NTLM authentication scheme.CustomNTLMAuthScheme(String challenge)
Constructor for the NTLM authentication scheme.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
authenticate(org.apache.commons.httpclient.Credentials credentials, String method, String uri)
Unsupported.String
authenticate(org.apache.commons.httpclient.Credentials credentials, org.apache.commons.httpclient.HttpMethod method)
Produces NTLM authorization string for the given set ofCredentials
.static String
authenticate(org.apache.commons.httpclient.NTCredentials credentials, String challenge)
Unsupported.static String
authenticate(org.apache.commons.httpclient.NTCredentials credentials, String challenge, String charset)
Unsupported.String
getID()
Unsupported.abstract String
getNTLMVersion()
Unsupported.String
getParameter(String name)
Returns the authentication parameter with the given name, if available.String
getRealm()
The concept of an authentication realm is not supported by the NTLM authentication scheme.String
getSchemeName()
Returns textual designation of the NTLM authentication scheme.boolean
isComplete()
Tests if the NTLM authentication process has been completed.boolean
isConnectionBased()
Returns true.void
processChallenge(String challenge)
Processes the NTLM challenge.
-
-
-
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 interfaceorg.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 interfaceorg.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 interfaceorg.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 interfaceorg.apache.commons.httpclient.auth.AuthScheme
- Returns:
- null
-
getID
public String getID()
Unsupported.- Specified by:
getID
in interfaceorg.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 interfaceorg.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 interfaceorg.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 interfaceorg.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 ofCredentials
.- Specified by:
authenticate
in interfaceorg.apache.commons.httpclient.auth.AuthScheme
- Parameters:
credentials
- The set of credentials to be used for athenticationmethod
- 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 schemeorg.apache.commons.httpclient.auth.AuthenticationException
- if authorization string cannot be generated due to an authentication failure- Since:
- 3.0
-
-