Top Description Inners Fields Constructors Methods
org.apache.hc.client5.http.impl.auth

public final Class NTLMScheme

extends Object
implements AuthScheme
Class Inheritance
All Implemented Interfaces
org.apache.hc.client5.http.auth.AuthScheme
Annotations
@Deprecated
Imports
java.security.Principal, org.apache.hc.client5.http.auth.AuthChallenge, .AuthScheme, .AuthScope, .AuthenticationException, .Credentials, .CredentialsProvider, .MalformedChallengeException, .StandardAuthScheme, org.apache.hc.client5.http.protocol.HttpClientContext, org.apache.hc.core5.http.HttpHost, .HttpRequest, org.apache.hc.core5.http.protocol.HttpContext, org.apache.hc.core5.util.Args, org.slf4j.Logger, .LoggerFactory

Deprecated

Do not use. the NTLM authentication scheme is no longer supported. Consider using Basic or Bearer authentication with TLS instead.

NTLM is a proprietary authentication scheme developed by Microsoft and optimized for Windows platforms.
Since
4.0
See Also
BasicScheme, BearerScheme

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

Modifier and TypeField and Description
private String
private NTCredentials
credentials

Deprecated as a consequence of NTCredentials being deprecated.
private final NTLMEngine
engine

Deprecated as a consequence of NTLMEngine being deprecated.
private static final Logger
private NTLMScheme.State

Constructor Summary

AccessConstructor and Description
public
NTLMScheme(final NTLMEngine engine)

Deprecated as a consequence of NTLMEngine being deprecated.
public

Method Summary

Modifier and TypeMethod and Description
public String
generateAuthResponse(final HttpHost host, final HttpRequest
The request being authenticated
request
,
final HttpContext
HTTP context
context
)

Implements org.apache.hc.client5.http.auth.AuthScheme.generateAuthResponse.

Generates an authorization response based on the current state.
public String
getName()

Implements org.apache.hc.client5.http.auth.AuthScheme.getName.

Returns textual designation of the given authentication scheme.
public Principal
getPrincipal()

Implements org.apache.hc.client5.http.auth.AuthScheme.getPrincipal.

Returns Principal whose credentials are used to generate an authentication response.
public String
getRealm()

Implements org.apache.hc.client5.http.auth.AuthScheme.getRealm.

Returns authentication realm.
public boolean
isChallengeComplete()

Implements org.apache.hc.client5.http.auth.AuthScheme.isChallengeComplete.

Authentication process may involve a series of challenge-response exchanges.
public boolean
isConnectionBased()

Implements org.apache.hc.client5.http.auth.AuthScheme.isConnectionBased.

Determines if the authentication scheme is expected to provide an authorization response on a per connection basis instead of the standard per request basis
public boolean
isResponseReady(final HttpHost host, final CredentialsProvider
The credentials to be used for authentication
credentialsProvider
,
final HttpContext
HTTP context
context
)

Implements org.apache.hc.client5.http.auth.AuthScheme.isResponseReady.

Determines whether or not an authorization response can be generated based on the actual authentication state.
public void
processChallenge(final AuthChallenge
the auth challenge
authChallenge
,
final HttpContext
HTTP context
context
)

Implements org.apache.hc.client5.http.auth.AuthScheme.processChallenge.

Processes the given auth challenge.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

challengeback to summary
private String challenge
credentialsback to summary
private NTCredentials credentials

Deprecated

as a consequence of NTCredentials being deprecated. See corresponding docs for further information.

engineback to summary
private final NTLMEngine engine

Deprecated

as a consequence of NTLMEngine being deprecated. See corresponding docs for further information.

LOGback to summary
private static final Logger LOG
stateback to summary
private NTLMScheme.State state

Constructor Detail

NTLMSchemeback to summary
public NTLMScheme(final NTLMEngine engine)

Deprecated

as a consequence of NTLMEngine being deprecated. See corresponding docs for further information.

NTLMSchemeback to summary
public NTLMScheme()
Since
4.3

Method Detail

generateAuthResponseback to summary
public String generateAuthResponse(final HttpHost host, final HttpRequest request, final HttpContext context) throws AuthenticationException

Implements org.apache.hc.client5.http.auth.AuthScheme.generateAuthResponse.

Doc from org.apache.hc.client5.http.auth.AuthScheme.generateAuthResponse.

Generates an authorization response based on the current state. Some authentication schemes may need to load user credentials required to generate an authorization response from a CredentialsProvider prior to this method call.

Parameters
request:HttpRequest

The request being authenticated

context:HttpContext

HTTP context

Returns:String

authorization header

Annotations
@Override
Exceptions
AuthenticationException:
if authorization string cannot be generated due to an authentication failure
getNameback to summary
public String getName()

Implements org.apache.hc.client5.http.auth.AuthScheme.getName.

Doc from org.apache.hc.client5.http.auth.AuthScheme.getName.

Returns textual designation of the given authentication scheme.

Returns:String

the name of the given authentication scheme

Annotations
@Override
getPrincipalback to summary
public Principal getPrincipal()

Implements org.apache.hc.client5.http.auth.AuthScheme.getPrincipal.

Doc from org.apache.hc.client5.http.auth.AuthScheme.getPrincipal.

Returns Principal whose credentials are used to generate an authentication response. Connection based schemes are required to return a user Principal if authorization applies to for the entire life span of connection.

Returns:Principal

user principal

Annotations
@Override
getRealmback to summary
public String getRealm()

Implements org.apache.hc.client5.http.auth.AuthScheme.getRealm.

Doc from org.apache.hc.client5.http.auth.AuthScheme.getRealm.

Returns authentication realm. If the concept of an authentication realm is not applicable to the given authentication scheme, returns null.

Returns:String

the authentication realm

Annotations
@Override
isChallengeCompleteback to summary
public boolean isChallengeComplete()

Implements org.apache.hc.client5.http.auth.AuthScheme.isChallengeComplete.

Doc from org.apache.hc.client5.http.auth.AuthScheme.isChallengeComplete.

Authentication process may involve a series of challenge-response exchanges. This method tests if the authorization process has been fully completed (either successfully or unsuccessfully), that is, all the required authorization challenges have been processed in their entirety.

Returns:boolean

true if the authentication process has been completed, false otherwise.

Annotations
@Override
isConnectionBasedback to summary
public boolean isConnectionBased()

Implements org.apache.hc.client5.http.auth.AuthScheme.isConnectionBased.

Doc from org.apache.hc.client5.http.auth.AuthScheme.isConnectionBased.

Determines if the authentication scheme is expected to provide an authorization response on a per connection basis instead of the standard per request basis

Returns:boolean

true if the scheme is connection based, false if the scheme is request based.

Annotations
@Override
isResponseReadyback to summary
public boolean isResponseReady(final HttpHost host, final CredentialsProvider credentialsProvider, final HttpContext context) throws AuthenticationException

Implements org.apache.hc.client5.http.auth.AuthScheme.isResponseReady.

Doc from org.apache.hc.client5.http.auth.AuthScheme.isResponseReady.

Determines whether or not an authorization response can be generated based on the actual authentication state. Generally the outcome of this method will depend upon availability of user credentials necessary to produce an authorization response.

Parameters
credentialsProvider:CredentialsProvider

The credentials to be used for authentication

context:HttpContext

HTTP context

Returns:boolean

true if an authorization response can be generated and the authentication handshake can proceed, false otherwise.

Annotations
@Override
Exceptions
AuthenticationException:
if authorization string cannot be generated due to an authentication failure
processChallengeback to summary
public void processChallenge(final AuthChallenge authChallenge, final HttpContext context) throws MalformedChallengeException

Implements org.apache.hc.client5.http.auth.AuthScheme.processChallenge.

Doc from org.apache.hc.client5.http.auth.AuthScheme.processChallenge.

Processes the given auth challenge. Some authentication schemes may involve multiple challenge-response exchanges. Such schemes must be able to maintain internal state when dealing with sequential challenges

Parameters
authChallenge:AuthChallenge

the auth challenge

context:HttpContext

HTTP context

Annotations
@Override
Exceptions
MalformedChallengeException:
in case the auth challenge is incomplete, malformed or otherwise invalid.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.apache.hc.client5.http.impl.auth back to summary

pack-priv final Enum NTLMScheme.State

extends Enum<NTLMScheme.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final NTLMScheme.State
public static final NTLMScheme.State
public static final NTLMScheme.State
public static final NTLMScheme.State
public static final NTLMScheme.State
public static final NTLMScheme.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static NTLMScheme.State
public static NTLMScheme.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CHALLENGE_RECEIVEDback to summary
public static final NTLMScheme.State CHALLENGE_RECEIVED
FAILEDback to summary
public static final NTLMScheme.State FAILED
MSG_TYPE1_GENERATEDback to summary
public static final NTLMScheme.State MSG_TYPE1_GENERATED
MSG_TYPE2_RECEIVEDback to summary
public static final NTLMScheme.State MSG_TYPE2_RECEIVED
MSG_TYPE3_GENERATEDback to summary
public static final NTLMScheme.State MSG_TYPE3_GENERATED
UNINITIATEDback to summary
public static final NTLMScheme.State UNINITIATED

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static NTLMScheme.State valueOf(String name)
valuesback to summary
public static NTLMScheme.State[] values()