org.apache.commons.httpclient

Class NTCredentials

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 16:51:46 -0400 (Wed, 19 Oct 2005) $

Author: Adrian Sutton Mike Bowler

Constructor Summary
NTCredentials()
Default constructor.
NTCredentials(String userName, String password, String host, String domain)
Constructor.
Method Summary
booleanequals(Object o)
Performs a case-sensitive check to see if the components of the credentials are the same.
StringgetDomain()
Retrieves the name to authenticate with.
StringgetHost()
Retrieves the host name of the computer originating the request.
inthashCode()
Computes a hash code based on all the case-sensitive parts of the credentials object.
voidsetDomain(String domain)
Sets the domain to authenticate with.
voidsetHost(String host)
Sets the host name of the computer originating the request.
StringtoString()
Return a string representation of this object.

Constructor Detail

NTCredentials

public NTCredentials()

Deprecated: Do not use. Null user name, domain & host no longer allowed

Default constructor.

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

equals

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

Parameters: o The object to match.

Returns: true if all of the credentials match.

getDomain

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

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

See Also:

getHost

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

Returns: String the host the user is logged into.

hashCode

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

Returns: The hash code for the credentials.

setDomain

public void setDomain(String domain)

Deprecated: Do not use. The NTCredentials objects should be immutable

Sets the domain to authenticate with. The domain may not be null.

Parameters: domain the NT domain to authenticate in.

See Also:

setHost

public void setHost(String host)

Deprecated: Do not use. The NTCredentials objects should be immutable

Sets the host name of the computer originating the request. The host name may not be null.

Parameters: host the Host the user is logged into.

toString

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

Returns: A string represenation of this object.

Copyright (c) 1999-2005 - Apache Software Foundation