|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.httpclient.auth.NTLMScheme
public class NTLMScheme
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 | |
---|---|
NTLMScheme()
Default constructor for the NTLM authentication scheme. |
|
NTLMScheme(String challenge)
Constructor for the NTLM authentication scheme. |
Method Summary | |
---|---|
String |
authenticate(Credentials credentials,
HttpMethod method)
Produces NTLM authorization string for the given set of Credentials . |
String |
authenticate(Credentials credentials,
String method,
String uri)
Deprecated. Use authenticate(Credentials, HttpMethod) |
static String |
authenticate(NTCredentials credentials,
String challenge)
Deprecated. Use non-static authenticate(Credentials, HttpMethod) |
static String |
authenticate(NTCredentials credentials,
String challenge,
String charset)
Deprecated. Use non-static authenticate(Credentials, HttpMethod) |
String |
getID()
Deprecated. no longer used |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NTLMScheme()
public NTLMScheme(String challenge) throws MalformedChallengeException
challenge
- The authentication challenge
MalformedChallengeException
- is thrown if the authentication challenge
is malformedMethod Detail |
---|
public void processChallenge(String challenge) throws MalformedChallengeException
processChallenge
in interface AuthScheme
challenge
- the challenge string
MalformedChallengeException
- is thrown if the authentication challenge
is malformedpublic boolean isComplete()
isComplete
in interface AuthScheme
public String getSchemeName()
getSchemeName
in interface AuthScheme
ntlm
public String getRealm()
null
.
getRealm
in interface AuthScheme
null
public String getID()
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.
getID
in interface AuthScheme
public String getParameter(String name)
There are no valid parameters for NTLM authentication so this method always returns null.
getParameter
in interface AuthScheme
name
- The name of the parameter to be returned
public boolean isConnectionBased()
isConnectionBased
in interface AuthScheme
public static String authenticate(NTCredentials credentials, String challenge) throws AuthenticationException
authenticate(Credentials, HttpMethod)
challenge
- The challenge.credentials
- NTCredentials
AuthenticationException
- is thrown if authentication failspublic static String authenticate(NTCredentials credentials, String challenge, String charset) throws AuthenticationException
authenticate(Credentials, HttpMethod)
challenge
- The challenge.credentials
- NTCredentials
charset
- The charset to use for encoding the credentials
AuthenticationException
- is thrown if authentication failspublic String authenticate(Credentials credentials, String method, String uri) throws AuthenticationException
authenticate(Credentials, HttpMethod)
Credentials
.
authenticate
in interface AuthScheme
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
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 failureHttpMethod.getName()
,
HttpMethod.getPath()
public String authenticate(Credentials credentials, HttpMethod method) throws AuthenticationException
Credentials
.
authenticate
in interface AuthScheme
credentials
- The set of credentials to be used for athenticationmethod
- The method being authenticated
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |