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

public abstract Class AuthSchemeBase

extends Object
implements ContextAwareAuthScheme
Class Inheritance
All Implemented Interfaces
org.apache.http.auth.ContextAwareAuthScheme, org.apache.http.auth.AuthScheme
Known Direct Subclasses
org.apache.http.impl.auth.GGSSchemeBase, org.apache.http.impl.auth.NTLMScheme, org.apache.http.impl.auth.RFC2617Scheme
Imports
java.util.Locale, org.apache.http.FormattedHeader, .Header, .HttpRequest, org.apache.http.auth.AUTH, .AuthenticationException, .ChallengeState, .ContextAwareAuthScheme, .Credentials, .MalformedChallengeException, org.apache.http.protocol.HTTP, .HttpContext, org.apache.http.util.Args, .CharArrayBuffer

Abstract authentication scheme class that serves as a basis for all authentication schemes supported by HttpClient. This class defines the generic way of parsing an authentication challenge. It does not make any assumptions regarding the format of the challenge nor does it impose any specific way of responding to that challenge.
Since
4.0

Field Summary

Modifier and TypeField and Description
protected ChallengeState

Constructor Summary

AccessConstructor and Description
public
AuthSchemeBase(final ChallengeState challengeState)

Deprecated (4.3) do not use.
Creates an instance of AuthSchemeBase with the given challenge state.
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
,
final HttpContext
HTTP context
context
)

Implements org.apache.http.auth.ContextAwareAuthScheme.authenticate.

Produces an authorization string for the given set of Credentials.
public ChallengeState
getChallengeState()

Returns ChallengeState value or null if unchallenged.

public boolean
isProxy()

Returns true if authenticating against a proxy, false otherwise.

protected abstract void
parseChallenge(CharArrayBuffer buffer, int beginIndex, int endIndex)

public void
processChallenge(final Header
the challenge header
header
)

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

Processes the given challenge token.
public String
toString()

Overrides java.lang.Object.toString.

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

Field Detail

challengeStateback to summary
protected ChallengeState challengeState

Constructor Detail

AuthSchemeBaseback to summary
public AuthSchemeBase(final ChallengeState challengeState)

Deprecated

(4.3) do not use.

Creates an instance of AuthSchemeBase with the given challenge state.

Annotations
@Deprecated
Since
4.2
AuthSchemeBaseback to summary
public AuthSchemeBase()

Method Detail

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

Implements org.apache.http.auth.ContextAwareAuthScheme.authenticate.

Doc from org.apache.http.auth.ContextAwareAuthScheme.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

context:HttpContext

HTTP context

Returns:Header

the authorization string

Annotations
@Override
@SuppressWarnings:deprecation
Exceptions
AuthenticationException:
if authorization string cannot be generated due to an authentication failure
getChallengeStateback to summary
public ChallengeState getChallengeState()

Returns ChallengeState value or null if unchallenged.

Since
4.2
isProxyback to summary
public boolean isProxy()

Returns true if authenticating against a proxy, false otherwise.

parseChallengeback to summary
protected abstract void parseChallenge(CharArrayBuffer buffer, int beginIndex, int endIndex) throws MalformedChallengeException
processChallengeback to summary
public void processChallenge(final Header header) throws MalformedChallengeException

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

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

Parameters
header:Header

the challenge header

Annotations
@Override
Exceptions
MalformedChallengeException:
is thrown if the authentication challenge is malformed
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