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

public Class NTLMScheme

extends AuthSchemeBase
Class Inheritance
Imports
org.apache.http.Header, .HttpRequest, org.apache.http.auth.AUTH, .AuthenticationException, .Credentials, .InvalidCredentialsException, .MalformedChallengeException, .NTCredentials, org.apache.http.message.BufferedHeader, org.apache.http.util.Args, .CharArrayBuffer

NTLM is a proprietary authentication scheme developed by Microsoft and optimized for Windows platforms.
Since
4.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

Modifier and TypeField and Description
private String
private final NTLMEngine
private NTLMScheme.State
Inherited from org.apache.http.impl.auth.AuthSchemeBase:
challengeState

Constructor Summary

AccessConstructor and Description
public
NTLMScheme(final NTLMEngine engine)

public

Method Summary

Modifier and TypeMethod and Description
public Header
authenticate(final Credentials
The set of credentials to be used for athentication
credentials
,
final HttpRequest
The request being authenticated
request
)

Implements org.apache.http.auth.AuthScheme.authenticate.

Produces an authorization string for the given set of Credentials.
public String
getParameter(final String
The name of the parameter to be returned
name
)

Implements org.apache.http.auth.AuthScheme.getParameter.

Returns authentication parameter with the given name, if available.
public String
getRealm()

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

Returns authentication realm.
public String
getSchemeName()

Implements org.apache.http.auth.AuthScheme.getSchemeName.

Returns textual designation of the given authentication scheme.
public boolean
isComplete()

Implements org.apache.http.auth.AuthScheme.isComplete.

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

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

Tests if the authentication scheme is provides authorization on a per connection basis instead of usual per request basis
protected void
parseChallenge(final CharArrayBuffer buffer, final int beginIndex, final int endIndex)

Implements abstract org.apache.http.impl.auth.AuthSchemeBase.parseChallenge.

Inherited from org.apache.http.impl.auth.AuthSchemeBase:
authenticategetChallengeStateisProxyprocessChallengetoString

Field Detail

challengeback to summary
private String challenge
engineback to summary
private final NTLMEngine engine
stateback to summary
private NTLMScheme.State state

Constructor Detail

NTLMSchemeback to summary
public NTLMScheme(final NTLMEngine engine)
NTLMSchemeback to summary
public NTLMScheme()
Since
4.3

Method Detail

authenticateback to summary
public Header authenticate(final Credentials credentials, final HttpRequest request) throws AuthenticationException

Implements org.apache.http.auth.AuthScheme.authenticate.

Doc from org.apache.http.auth.AuthScheme.authenticate.

Produces an authorization string for the given set of Credentials.

Parameters
credentials:Credentials

The set of credentials to be used for athentication

request:HttpRequest

The request being authenticated

Returns:Header

the authorization string

Annotations
@Override
Exceptions
AuthenticationException:
if authorization string cannot be generated due to an authentication failure
getParameterback to summary
public String getParameter(final String name)

Implements org.apache.http.auth.AuthScheme.getParameter.

Doc from org.apache.http.auth.AuthScheme.getParameter.

Returns authentication parameter with the given name, if available.

Parameters
name:String

The name of the parameter to be returned

Returns:String

the parameter with the given name

Annotations
@Override
getRealmback to summary
public String getRealm()

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

Doc from org.apache.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
getSchemeNameback to summary
public String getSchemeName()

Implements org.apache.http.auth.AuthScheme.getSchemeName.

Doc from org.apache.http.auth.AuthScheme.getSchemeName.

Returns textual designation of the given authentication scheme.

Returns:String

the name of the given authentication scheme

Annotations
@Override
isCompleteback to summary
public boolean isComplete()

Implements org.apache.http.auth.AuthScheme.isComplete.

Doc from org.apache.http.auth.AuthScheme.isComplete.

Authentication process may involve a series of challenge-response exchanges. This method tests if the authorization process has been 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.http.auth.AuthScheme.isConnectionBased.

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

Tests if the authentication scheme is provides authorization on a per connection basis instead of usual per request basis

Returns:boolean

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

Annotations
@Override
parseChallengeback to summary
protected void parseChallenge(final CharArrayBuffer buffer, final int beginIndex, final int endIndex) throws MalformedChallengeException

Implements abstract org.apache.http.impl.auth.AuthSchemeBase.parseChallenge.

Annotations
@Override
org.apache.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_RECEVIEDback to summary
public static final NTLMScheme.State MSG_TYPE2_RECEVIED
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()