Build 1.0_r1(from source)

org.apache.http.auth
Class NTCredentials

java.lang.Object
  extended by org.apache.http.auth.NTCredentials
All Implemented Interfaces:
Credentials

public class NTCredentials
extends Object
implements Credentials

Credentials specific to the Windows platform.

Since:
2.0

Constructor Summary
NTCredentials(String usernamePassword)
          The constructor with the fully qualified username and password combined string argument.
NTCredentials(String userName, String password, String workstation, String domain)
          Constructor.
 
Method Summary
 boolean equals(Object o)
          Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
 String getDomain()
          Retrieves the name to authenticate with.
 String getPassword()
           
 String getUserName()
           
 Principal getUserPrincipal()
           
 String getWorkstation()
          Retrieves the workstation name of the computer originating the request.
 int hashCode()
          Returns an integer hash code for the receiver.
 String toString()
          Returns a string containing a concise, human-readable description of the receiver.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NTCredentials

public NTCredentials(String usernamePassword)
The constructor with the fully qualified username and password combined string argument.

Parameters:
usernamePassword - the domain/username:password formed string

NTCredentials

public NTCredentials(String userName,
                     String password,
                     String workstation,
                     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.
workstation - The workstation the authentication request is originating from. Essentially, the computer name for this machine.
domain - The domain to authenticate within.
Method Detail

getUserPrincipal

public Principal getUserPrincipal()
Specified by:
getUserPrincipal in interface Credentials

getUserName

public String getUserName()

getPassword

public String getPassword()
Specified by:
getPassword in interface Credentials

getDomain

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

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

getWorkstation

public String getWorkstation()
Retrieves the workstation name of the computer originating the request.

Returns:
String the workstation the user is logged into.

hashCode

public int hashCode()
Description copied from class: Object
Returns an integer hash code for the receiver. Any two objects which answer true when passed to .equals must answer the same value for this method.

Overrides:
hashCode in class Object
Returns:
int the receiver's hash.
See Also:
Object.equals(java.lang.Object)

equals

public boolean equals(Object o)
Description copied from class: Object
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. The implementation in Object returns true only if the argument is the exact same object as the receiver (==).

Overrides:
equals in class Object
Parameters:
o - Object the object to compare with this object.
Returns:
boolean true if the object is the same as this object false if it is different from this object.
See Also:
Object.hashCode()

toString

public String toString()
Description copied from class: Object
Returns a string containing a concise, human-readable description of the receiver.

Overrides:
toString in class Object
Returns:
String a printable representation for the receiver.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature