Package org.apache.hc.client5.http.auth
Class NTCredentials
- java.lang.Object
-
- org.apache.hc.client5.http.auth.NTCredentials
-
- All Implemented Interfaces:
java.io.Serializable,Credentials
@Contract(threading=IMMUTABLE) public class NTCredentials extends java.lang.Object implements Credentials, java.io.Serializable
Microsoft Windows specificCredentialsrepresentation that includes Windows specific attributes such as name of the domain the user belongs to.- Since:
- 4.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringnetbiosDomainThe netbios domain the authentication request is againstprivate char[]passwordPasswordprivate NTUserPrincipalprincipalThe user principalprivate static longserialVersionUIDprivate java.lang.StringworkstationThe netbios hostname the authentication request is originating from.
-
Constructor Summary
Constructors Constructor Description NTCredentials(java.lang.String userName, char[] password, java.lang.String workstation, java.lang.String domain)Constructor.NTCredentials(java.lang.String userName, char[] password, java.lang.String workstation, java.lang.String domain, java.lang.String netbiosDomain)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.StringconvertDomain(java.lang.String domain)Convert domain to standard formprivate static java.lang.StringconvertHost(java.lang.String host)Convert host to standard formbooleanequals(java.lang.Object o)java.lang.StringgetDomain()Retrieves the name to authenticate with.java.lang.StringgetNetbiosDomain()Retrieves the netbios domain to authenticate with.char[]getPassword()java.lang.StringgetUserName()java.security.PrincipalgetUserPrincipal()java.lang.StringgetWorkstation()Retrieves the netbios workstation name of the computer originating the request.inthashCode()private static java.lang.StringstripDotSuffix(java.lang.String value)Strip dot suffix from a namejava.lang.StringtoString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
principal
private final NTUserPrincipal principal
The user principal
-
password
private final char[] password
Password
-
workstation
private final java.lang.String workstation
The netbios hostname the authentication request is originating from.
-
netbiosDomain
private final java.lang.String netbiosDomain
The netbios domain the authentication request is against
-
-
Constructor Detail
-
NTCredentials
public NTCredentials(java.lang.String userName, char[] password, java.lang.String workstation, java.lang.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.
-
NTCredentials
public NTCredentials(java.lang.String userName, char[] password, java.lang.String workstation, java.lang.String domain, java.lang.String netbiosDomain)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 netbios workstation name that the authentication request is originating from. Essentially, the computer name for this machine.domain- The domain to authenticate within.netbiosDomain- The netbios version of the domain name.
-
-
Method Detail
-
getUserPrincipal
public java.security.Principal getUserPrincipal()
- Specified by:
getUserPrincipalin interfaceCredentials
-
getUserName
public java.lang.String getUserName()
-
getPassword
public char[] getPassword()
- Specified by:
getPasswordin interfaceCredentials
-
getDomain
public java.lang.String getDomain()
Retrieves the name to authenticate with.- Returns:
- String the domain these credentials are intended to authenticate with.
-
getNetbiosDomain
public java.lang.String getNetbiosDomain()
Retrieves the netbios domain to authenticate with.- Returns:
- String the netbios domain name.
-
getWorkstation
public java.lang.String getWorkstation()
Retrieves the netbios workstation name of the computer originating the request.- Returns:
- String the netbios workstation the user is logged into.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
stripDotSuffix
private static java.lang.String stripDotSuffix(java.lang.String value)
Strip dot suffix from a name
-
convertHost
private static java.lang.String convertHost(java.lang.String host)
Convert host to standard form
-
convertDomain
private static java.lang.String convertDomain(java.lang.String domain)
Convert domain to standard form
-
-