Package org.apache.hc.client5.http.auth
Class NTCredentials
java.lang.Object
org.apache.hc.client5.http.auth.NTCredentials
- All Implemented Interfaces:
Serializable,Credentials
@Contract(threading=IMMUTABLE)
public class NTCredentials
extends Object
implements Credentials, Serializable
Microsoft Windows specific
Credentials representation that includes
Windows specific attributes such as name of the domain the user belongs to.- Since:
- 4.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe netbios domain the authentication request is againstprivate final char[]Passwordprivate final NTUserPrincipalThe user principalprivate static final longprivate final StringThe netbios hostname the authentication request is originating from. -
Constructor Summary
ConstructorsConstructorDescriptionNTCredentials(String userName, char[] password, String workstation, String domain) Constructor.NTCredentials(String userName, char[] password, String workstation, String domain, String netbiosDomain) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringconvertDomain(String domain) Convert domain to standard formprivate static StringconvertHost(String host) Convert host to standard formbooleanRetrieves the name to authenticate with.Retrieves the netbios domain to authenticate with.char[]Retrieves the netbios workstation name of the computer originating the request.inthashCode()private static StringstripDotSuffix(String value) Strip dot suffix from a nametoString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
principal
The user principal -
password
private final char[] passwordPassword -
workstation
The netbios hostname the authentication request is originating from. -
netbiosDomain
The netbios domain the authentication request is against
-
-
Constructor Details
-
NTCredentials
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(String userName, char[] password, String workstation, String domain, 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 Details
-
getUserPrincipal
- Specified by:
getUserPrincipalin interfaceCredentials
-
getUserName
-
getPassword
public char[] getPassword()- Specified by:
getPasswordin interfaceCredentials
-
getDomain
Retrieves the name to authenticate with.- Returns:
- String the domain these credentials are intended to authenticate with.
-
getNetbiosDomain
Retrieves the netbios domain to authenticate with.- Returns:
- String the netbios domain name.
-
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() -
equals
-
toString
-
stripDotSuffix
Strip dot suffix from a name -
convertHost
Convert host to standard form -
convertDomain
Convert domain to standard form
-