org.apache.commons.httpclient
Class NTCredentials

java.lang.Object
  extended by org.apache.commons.httpclient.UsernamePasswordCredentials
      extended by org.apache.commons.httpclient.NTCredentials
All Implemented Interfaces:
Credentials

public class NTCredentials
extends UsernamePasswordCredentials

Credentials for use with the NTLM authentication scheme which requires additional information.

Since:
2.0
Version:
$Revision: 326707 $ $Date: 2005-10-19 22:51:46 +0200 (Mi, 19 Okt 2005) $
Author:
Adrian Sutton, Mike Bowler

Constructor Summary
NTCredentials(String userName, String password, String host, String domain)
          Constructor.
 
Method Summary
 boolean equals(Object o)
          Performs a case-sensitive check to see if the components of the credentials are the same.
 String getDomain()
          Retrieves the name to authenticate with.
 String getHost()
          Retrieves the host name of the computer originating the request.
 int hashCode()
          Computes a hash code based on all the case-sensitive parts of the credentials object.
 String toString()
          Return a string representation of this object.
 
Methods inherited from class org.apache.commons.httpclient.UsernamePasswordCredentials
getPassword, getUserName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NTCredentials

public NTCredentials(String userName,
                     String password,
                     String host,
                     String domain)
Constructor.

Parameters:
userName - The user name. This should not include the domain to authenticate with. For example: "user" is correct whereas "DOMAIN\\user" is not.
password - The password.
host - The host the authentication request is originating from. Essentially, the computer name for this machine.
domain - The domain to authenticate within.
Method Detail

getDomain

public String getDomain()
Retrieves the name to authenticate with.

Returns:
String the domain these credentials are intended to authenticate with.

getHost

public String getHost()
Retrieves the host name of the computer originating the request.

Returns:
String the host the user is logged into.

toString

public String toString()
Return a string representation of this object.

Overrides:
toString in class UsernamePasswordCredentials
Returns:
A string represenation of this object.

hashCode

public int hashCode()
Computes a hash code based on all the case-sensitive parts of the credentials object.

Overrides:
hashCode in class UsernamePasswordCredentials
Returns:
The hash code for the credentials.

equals

public boolean equals(Object o)
Performs a case-sensitive check to see if the components of the credentials are the same.

Overrides:
equals in class UsernamePasswordCredentials
Parameters:
o - The object to match.
Returns:
true if all of the credentials match.


Copyright (c) 1999-2005 - Apache Software Foundation