Package org.apache.hc.client5.http.auth
Class NTCredentials
java.lang.Object
org.apache.hc.client5.http.auth.NTCredentials
- All Implemented Interfaces:
Serializable
,Credentials
@Deprecated
@Contract(threading=IMMUTABLE)
public class NTCredentials
extends Object
implements Credentials, Serializable
Deprecated.
Do not use. the NTLM authentication scheme is no longer supported.
Consider using Basic or Bearer authentication with TLS instead.
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 String
Deprecated.The netbios domain the authentication request is againstprivate final char[]
Deprecated.Passwordprivate final NTUserPrincipal
Deprecated.The user principalprivate static final long
Deprecated.private final String
Deprecated.The netbios hostname the authentication request is originating from. -
Constructor Summary
ConstructorsConstructorDescriptionNTCredentials
(char[] password, String userName, String domain, String netbiosDomain) Deprecated.Constructor to create an instance of NTCredentials.NTCredentials
(String userName, char[] password, String workstation, String domain) Deprecated.Constructor.NTCredentials
(String userName, char[] password, String workstation, String domain, String netbiosDomain) Deprecated.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
convertDomain
(String domain) Deprecated.Convert domain to standard formboolean
Deprecated.Deprecated.Retrieves the name to authenticate with.Deprecated.Retrieves the netbios domain to authenticate with.char[]
Deprecated.Deprecated.Deprecated.Deprecated.Retrieves the netbios workstation name of the computer originating the request.private static String
Deprecated.Retrieves the workstation name of the computer originating the request.int
hashCode()
Deprecated.private static String
stripDotSuffix
(String value) Deprecated.Strip dot suffix from a nametoString()
Deprecated.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDDeprecated.- See Also:
-
principal
Deprecated.The user principal -
password
private final char[] passwordDeprecated.Password -
workstation
Deprecated.The netbios hostname the authentication request is originating from. -
netbiosDomain
Deprecated.The netbios domain the authentication request is against
-
-
Constructor Details
-
NTCredentials
Deprecated.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) Deprecated.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.
-
NTCredentials
Deprecated.Constructor to create an instance of NTCredentials.- Parameters:
password
- The password to use for authentication. Must not be null.userName
- The user name for authentication. This should not include the domain to authenticate with. For example: "user" is correct whereas "DOMAIN\user" is not. Must not be null.domain
- The domain to authenticate within. Can be null.netbiosDomain
- An alternative representation of the domain name in NetBIOS format. Can be null. This parameter is provided to accommodate specific scenarios that require the NetBIOS version of the domain name.This constructor creates a new instance of NTCredentials, determining the workstation name at runtime using the
getWorkstationName()
method. The workstation name will be converted to uppercase using theLocale.ROOT
locale.
-
-
Method Details
-
getUserPrincipal
Deprecated.- Specified by:
getUserPrincipal
in interfaceCredentials
-
getUserName
Deprecated. -
getPassword
public char[] getPassword()Deprecated.- Specified by:
getPassword
in interfaceCredentials
-
getDomain
Deprecated.Retrieves the name to authenticate with.- Returns:
- String the domain these credentials are intended to authenticate with.
-
getNetbiosDomain
Deprecated.Retrieves the netbios domain to authenticate with.- Returns:
- String the netbios domain name.
-
getWorkstation
Deprecated.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()Deprecated. -
equals
Deprecated. -
toString
Deprecated. -
stripDotSuffix
Deprecated.Strip dot suffix from a name -
convertDomain
Deprecated.Convert domain to standard form -
getWorkstationName
Deprecated.Retrieves the workstation name of the computer originating the request. This method attempts to get the local host name using the InetAddress class. If it fails to retrieve the host name due to an UnknownHostException, it returns "localhost" as a fallback.- Returns:
- The unqualified workstation name as a String.
-