Android
org.apache.http.auth
public interface

org.apache.http.auth.AuthScheme

org.apache.http.auth.AuthScheme

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

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

  • Parse and process the challenge sent by the targer server in response to request for a protected resource
  • Provide its textual designation
  • Provide its parameters, if available
  • Provide the realm this authentication scheme is applicable to, if available
  • Generate authorization string for the given set of credentials, request method and URI as specificed in the HTTP request line in response to the actual authorization challenge

Authentication schemes may ignore method name and URI parameters if they are not relevant for the given authentication mechanism

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

Summary

Public Methods

          Header  authenticate(Credentials credentials, HttpRequest request)
Produces an authorization string for the given set of Credentials.
          String  getParameter(String name)
Returns authentication parameter with the given name, if available.
          String  getRealm()
Returns authentication realm.
          String  getSchemeName()
Returns textual designation of the given authentication scheme.
          boolean  isComplete()
Authentication process may involve a series of challenge-response exchanges.
          boolean  isConnectionBased()
Tests if the authentication scheme is provides authorization on a per connection basis instead of usual per request basis
          void  processChallenge(Header header)
Processes the given challenge token.

Details

Public Methods

public Header authenticate(Credentials credentials, HttpRequest request)

Produces an authorization string for the given set of Credentials.

Parameters

credentials The set of credentials to be used for athentication
request The request being authenticated

Returns

  • the authorization string

Throws

AuthenticationException if authorization string cannot be generated due to an authentication failure

public String getParameter(String name)

Returns authentication parameter with the given name, if available.

Parameters

name The name of the parameter to be returned

Returns

  • the parameter with the given name

public String getRealm()

Returns authentication realm. If the concept of an authentication realm is not applicable to the given authentication scheme, returns null.

Returns

  • the authentication realm

public String getSchemeName()

Returns textual designation of the given authentication scheme.

Returns

  • the name of the given authentication scheme

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

  • true if the authentication process has been completed, false otherwise.

public boolean isConnectionBased()

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

Returns

  • true if the scheme is connection based, false if the scheme is request based.

public void processChallenge(Header header)

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 the challenge header
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48