Save This Page
Home » commons-httpclient-3.1-src » org.apache.commons » httpclient » auth » [javadoc | source]
org.apache.commons.httpclient.auth
public interface: AuthScheme [javadoc | source]

All Known Implementing Classes:
    NegotiateScheme, NTLMScheme, BasicScheme, DigestScheme, AuthSchemeBase, RFC2617Scheme

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

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

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

Method from org.apache.commons.httpclient.auth.AuthScheme Summary:
authenticate,   authenticate,   getID,   getParameter,   getRealm,   getSchemeName,   isComplete,   isConnectionBased,   processChallenge
Method from org.apache.commons.httpclient.auth.AuthScheme Detail:
 public String authenticate(Credentials credentials,
    HttpMethod method) throws AuthenticationException
    Produces an authorization string for the given set of Credentials .
 public String authenticate(Credentials credentials,
    String method,
    String uri) throws AuthenticationExceptionDeprecated! Use -  #authenticate(Credentials, HttpMethod) 

Produces an authorization string for the given set of Credentials ,
method name and URI using the given authentication scheme in response to
the actual authorization challenge.

 public String getID()Deprecated! no -  longer used

    Returns a String identifying the authentication challenge. This is used, in combination with the host and port to determine if authorization has already been attempted or not. Schemes which require multiple requests to complete the authentication should return a different value for each stage in the request.

    Additionally, the ID should take into account any changes to the authentication challenge and return a different value when appropriate. For example when the realm changes in basic authentication it should be considered a different authentication attempt and a different value should be returned.

 public String getParameter(String name)
    Returns authentication parameter with the given name, if available.
 public String getRealm()
    Returns authentication realm. If the concept of an authentication realm is not applicable to the given authentication scheme, returns null.
 public String getSchemeName()
    Returns textual designation 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.
 public boolean isConnectionBased()
    Tests if the authentication scheme is provides authorization on a per connection basis instead of usual per request basis
 public  void processChallenge(String challenge) 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