|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.httpclient.auth.NTLM
Provides an implementation of the NTLM authentication protocol.
This class provides methods for generating authentication challenge responses for the NTLM authentication protocol. The NTLM protocol is a proprietary Microsoft protocol and as such no RFC exists for it. This class is based upon the reverse engineering efforts of a wide range of people.
Please note that an implementation of JCE must be correctly installed and configured when using NTLM support.
This class should not be used externally to HttpClient as it's API is specifically designed to work with HttpClient's use case, in particular it's connection management.
Field Summary | |
static java.lang.String |
DEFAULT_CHARSET
Character encoding |
Constructor Summary | |
(package private) |
NTLM()
|
Method Summary | |
java.lang.String |
getCredentialCharset()
|
java.lang.String |
getResponseFor(java.lang.String message,
java.lang.String username,
java.lang.String password,
java.lang.String host,
java.lang.String domain)
Returns the response for the given message. |
java.lang.String |
getType1Message(java.lang.String host,
java.lang.String domain)
Creates the first message (type 1 message) in the NTLM authentication sequence. |
java.lang.String |
getType3Message(java.lang.String user,
java.lang.String password,
java.lang.String host,
java.lang.String domain,
byte[] nonce)
Creates the type 3 message using the given server nonce. |
byte[] |
parseType2Message(java.lang.String message)
Extracts the server nonce out of the given message type 2. |
void |
setCredentialCharset(java.lang.String credentialCharset)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_CHARSET
Constructor Detail |
NTLM()
Method Detail |
public final java.lang.String getResponseFor(java.lang.String message, java.lang.String username, java.lang.String password, java.lang.String host, java.lang.String domain) throws AuthenticationException
message
- the message that was received from the server.username
- the username to authenticate with.password
- the password to authenticate with.host
- The host.domain
- the NT domain to authenticate in.
HttpException
- If the messages cannot be retrieved.
AuthenticationException
public java.lang.String getType1Message(java.lang.String host, java.lang.String domain)
host
- the computer name of the host requesting authentication.domain
- The domain to authenticate with.
public byte[] parseType2Message(java.lang.String message)
message
- the String containing the base64 encoded message.
public java.lang.String getType3Message(java.lang.String user, java.lang.String password, java.lang.String host, java.lang.String domain, byte[] nonce) throws AuthenticationException
user
- The user name. This should not include the domain name.password
- The password.host
- The host that is originating the authentication request.domain
- The domain to authenticate within.nonce
- the 8 byte array the server sent.
AuthenticationException
- If fails.public java.lang.String getCredentialCharset()
public void setCredentialCharset(java.lang.String credentialCharset)
credentialCharset
- The credentialCharset to set.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |