## org.apache.http.impl.client
Class AbstractAuthenticationHandler

    java.lang.Object
      org.apache.http.impl.client.AbstractAuthenticationHandler

All Implemented Interfaces:
  AuthenticationHandler

Direct Known Subclasses:
  DefaultProxyAuthenticationHandler, DefaultTargetAuthenticationHandler

    @Immutable
    public abstract class AbstractAuthenticationHandler

extends Object
implements AuthenticationHandler

Base class for `AuthenticationHandler` implementations.

Since:
  4.0

Constructor Summary
`AbstractAuthenticationHandler()`

Method Summary
`protected List<String>` `getAuthPreferences()` Returns default list of auth scheme names in their order of preference.
`protected List<String>` `getAuthPreferences(HttpResponse response, HttpContext 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(Header[] headers)`
`AuthScheme` `selectScheme(Map<String,Header> challenges, HttpResponse response, HttpContext context)` Selects one authentication challenge out of all available and creates and generates `AuthScheme` instance capable of processing that challenge.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.apache.http.client.AuthenticationHandler
`getChallenges, isAuthenticationRequested`

Constructor Detail

### AbstractAuthenticationHandler

    public AbstractAuthenticationHandler()

Method Detail

### parseChallenges

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

  Throws:
    `MalformedChallengeException`

### getAuthPreferences

    protected List<String> getAuthPreferences()

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

  Returns:
    list of auth scheme names

### getAuthPreferences

    protected List<String> getAuthPreferences(HttpResponse response,
                                              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` - HTTP response.
    `context` - HTTP execution context.
  Since:
    4.1

### selectScheme

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

  Description copied from interface: `AuthenticationHandler`
  Selects one authentication challenge out of all available and creates and generates `AuthScheme` instance capable of processing that challenge.

  Specified by:
    `selectScheme` in interface `AuthenticationHandler`
  Parameters:
    `challenges` - collection of challenges.
    `response` - HTTP response.
    `context` - HTTP context.
  Returns:
    authentication scheme to use for authentication.
  Throws:
    `AuthenticationException` - if an authentication scheme could not be selected.

Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.