Top Description Methods
org.apache.http.auth

public Interface AuthScheme

Known Direct Subinterfaces
org.apache.http.auth.ContextAwareAuthScheme
Imports
org.apache.http.Header, .HttpRequest

This interface represents an abstract challenge-response oriented authentication scheme.

An authentication scheme should be able to support the following functions:

Authentication schemes may be stateful involving a series of challenge-response exchanges.

Important Note

implementations of this interface MUST also implement ContextAwareAuthScheme interface in order to remain API compatible with newer versions of HttpClient.

Since
4.0

Method Summary

Modifier and TypeMethod and Description
public Header

Returns:

the authorization string
authenticate
(Credentials
The set of credentials to be used for athentication
credentials
,
HttpRequest
The request being authenticated
request
)

Produces an authorization string for the given set of Credentials.
public String

Returns:

the parameter with the given name
getParameter
(final String
The name of the parameter to be returned
name
)

Returns authentication parameter with the given name, if available.

public String

Returns:

the authentication realm
getRealm
()

Returns authentication realm.

public String

Returns:

the name of the given authentication scheme
getSchemeName
()

Returns textual designation of the given authentication scheme.

public boolean

Returns:

true if the authentication process has been completed, false otherwise.
isComplete
()

Authentication process may involve a series of challenge-response exchanges.

public boolean

Returns:

true if the scheme is connection based, false if the scheme is request based.
isConnectionBased
()

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

public void
processChallenge(final Header
the challenge header
header
)

Processes the given challenge token.

Method Detail

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

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
@Deprecated
Exceptions
AuthenticationException:
if authorization string cannot be generated due to an authentication failure
getParameterback to summary
public String getParameter(final String name)

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

getRealmback to summary
public String 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

getSchemeNameback to summary
public String getSchemeName()

Returns textual designation of the given authentication scheme.

Returns:String

the name of the given authentication scheme

isCompleteback to summary
public boolean 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.

isConnectionBasedback to summary
public boolean 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.

processChallengeback to summary
public void processChallenge(final Header header) throws MalformedChallengeException

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