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

public abstract Class AbstractAuthenticationHandler

extends Object
implements AuthenticationHandler
Class Inheritance
All Implemented Interfaces
org.apache.http.client.AuthenticationHandler
Known Direct Subclasses
org.apache.http.impl.client.DefaultProxyAuthenticationHandler, org.apache.http.impl.client.DefaultTargetAuthenticationHandler
Annotations
@Deprecated
@Contract
threading:IMMUTABLE
Imports
java.util.Arrays, .Collection, .Collections, .HashMap, .List, .Locale, .Map, org.apache.commons.logging.Log, .LogFactory, org.apache.http.FormattedHeader, .Header, .HttpResponse, org.apache.http.annotation.Contract, .ThreadingBehavior, org.apache.http.auth.AuthScheme, .AuthSchemeRegistry, .AuthenticationException, .MalformedChallengeException, org.apache.http.client.AuthenticationHandler, org.apache.http.client.params.AuthPolicy, org.apache.http.client.protocol.ClientContext, org.apache.http.protocol.HTTP, .HttpContext, org.apache.http.util.Asserts, .CharArrayBuffer

Deprecated

(4.2) use org.apache.http.client.AuthenticationStrategy

Base class for AuthenticationHandler implementations.
Since
4.0

Field Summary

Modifier and TypeField and Description
private static final List<String>
private final Log

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected List<String>

Returns:

list of auth scheme names
getAuthPreferences
()

Returns default list of auth scheme names in their order of preference.

protected List<String>
getAuthPreferences(final HttpResponse
HTTP response.
response
,
final HttpContext
HTTP execution context.
context
)

Returns default list of auth scheme names in their order of preference based on the HTTP response and the current execution context.

protected Map<String, Header>
parseChallenges(final Header[] headers)

public AuthScheme
selectScheme(final Map<String, Header>
collection of challenges.
challenges
,
final HttpResponse
HTTP response.
response
,
final HttpContext
HTTP context.
context
)

Implements org.apache.http.client.AuthenticationHandler.selectScheme.

Selects one authentication challenge out of all available and creates and generates AuthScheme instance capable of processing that challenge.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_SCHEME_PRIORITYback to summary
private static final List<String> DEFAULT_SCHEME_PRIORITY
logback to summary
private final Log log

Constructor Detail

AbstractAuthenticationHandlerback to summary
public AbstractAuthenticationHandler()

Method Detail

getAuthPreferencesback to summary
protected List<String> getAuthPreferences()

Returns default list of auth scheme names in their order of preference.

Returns:List<String>

list of auth scheme names

getAuthPreferencesback to summary
protected List<String> getAuthPreferences(final HttpResponse response, final HttpContext context)

Returns default list of auth scheme names in their order of preference based on the HTTP response and the current execution context.

Parameters
response:HttpResponse

HTTP response.

context:HttpContext

HTTP execution context.

Since
4.1
parseChallengesback to summary
protected Map<String, Header> parseChallenges(final Header[] headers) throws MalformedChallengeException
selectSchemeback to summary
public AuthScheme selectScheme(final Map<String, Header> challenges, final HttpResponse response, final HttpContext context) throws AuthenticationException

Implements org.apache.http.client.AuthenticationHandler.selectScheme.

Doc from org.apache.http.client.AuthenticationHandler.selectScheme.

Selects one authentication challenge out of all available and creates and generates AuthScheme instance capable of processing that challenge.

Parameters
challenges:Map<String, Header>

collection of challenges.

response:HttpResponse

HTTP response.

context:HttpContext

HTTP context.

Returns:AuthScheme

authentication scheme to use for authentication.

Annotations
@Override
Exceptions
AuthenticationException:
if an authentication scheme could not be selected.