Top Description Methods
org.apache.http.client

public Interface AuthenticationHandler

Known Direct Implementers
org.apache.http.impl.client.AbstractAuthenticationHandler
Annotations
@Deprecated
Imports
java.util.Map, org.apache.http.Header, .HttpResponse, org.apache.http.auth.AuthScheme, .AuthenticationException, .MalformedChallengeException, org.apache.http.protocol.HttpContext

Deprecated

(4.2) use AuthenticationStrategy

/** A handler for determining if an HTTP response represents an authentication challenge that was sent back to the client as a result of authentication failure.

Implementations of this interface must be thread-safe. Access to shared data must be synchronized as methods of this interface may be executed from multiple threads.

Since
4.0

Method Summary

Modifier and TypeMethod and Description
public Map<String, Header>

Returns:

a collection of challenges keyed by names of corresponding authentication schemes.
getChallenges
(HttpResponse
HTTP response.
response
,
HttpContext
HTTP context.
context
)

Extracts from the given HTTP response a collection of authentication challenges, each of which represents an authentication scheme supported by the authentication host.

public boolean

Returns:

true if user authentication is required, false otherwise.
isAuthenticationRequested
(HttpResponse
HTTP response.
response
,
HttpContext
HTTP context.
context
)

Determines if the given HTTP response response represents an authentication challenge that was sent back as a result of authentication failure

public AuthScheme

Returns:

authentication scheme to use for authentication.
selectScheme
(Map<String, Header>
collection of challenges.
challenges
,
HttpResponse
HTTP response.
response
,
HttpContext
HTTP context.
context
)

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

Method Detail

getChallengesback to summary
public Map<String, Header> getChallenges(HttpResponse response, HttpContext context) throws MalformedChallengeException

Extracts from the given HTTP response a collection of authentication challenges, each of which represents an authentication scheme supported by the authentication host.

Parameters
response:HttpResponse

HTTP response.

context:HttpContext

HTTP context.

Returns:Map<String, Header>

a collection of challenges keyed by names of corresponding authentication schemes.

Exceptions
MalformedChallengeException:
if one of the authentication challenges is not valid or malformed.
isAuthenticationRequestedback to summary
public boolean isAuthenticationRequested(HttpResponse response, HttpContext context)

Determines if the given HTTP response response represents an authentication challenge that was sent back as a result of authentication failure

Parameters
response:HttpResponse

HTTP response.

context:HttpContext

HTTP context.

Returns:boolean

true if user authentication is required, false otherwise.

selectSchemeback to summary
public AuthScheme selectScheme(Map<String, Header> challenges, HttpResponse response, HttpContext context) throws AuthenticationException

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.

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