FileDocCategorySizeDatePackage
AuthScheme.javaAPI DocAndroid 1.5 API5132Wed May 06 22:41:10 BST 2009org.apache.http.auth

AuthScheme

public interface 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

author
Oleg Kalnichevski
author
Adrian Sutton
since
4.0

Fields Summary
Constructors Summary
Methods Summary
public org.apache.http.Headerauthenticate(org.apache.http.auth.Credentials credentials, org.apache.http.HttpRequest request)
Produces an authorization string for the given set of {@link Credentials}.

param
credentials The set of credentials to be used for athentication
param
request The request being authenticated
throws
AuthenticationException if authorization string cannot be generated due to an authentication failure
return
the authorization string

public java.lang.StringgetParameter(java.lang.String name)
Returns authentication parameter with the given name, if available.

param
name The name of the parameter to be returned
return
the parameter with the given name

public java.lang.StringgetRealm()
Returns authentication realm. If the concept of an authentication realm is not applicable to the given authentication scheme, returns null.

return
the authentication realm

public java.lang.StringgetSchemeName()
Returns textual designation of the given authentication scheme.

return
the name of the given authentication scheme

public booleanisComplete()
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.

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

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

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

public voidprocessChallenge(org.apache.http.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

param
header the challenge header