org.apache.commons.httpclient.auth
Class RFC2617Scheme

java.lang.Object
  |
  +--org.apache.commons.httpclient.auth.AuthSchemeBase
        |
        +--org.apache.commons.httpclient.auth.RFC2617Scheme
Direct Known Subclasses:
BasicScheme, DigestScheme

public abstract class RFC2617Scheme
extends AuthSchemeBase

Abstract authentication scheme class that lays foundation for all RFC 2617 compliant authetication schemes and provides capabilities common to all authentication schemes defined in RFC 2617.

Author:
Oleg Kalnichevski

Constructor Summary
RFC2617Scheme(java.lang.String challenge)
          Default constructor for RFC2617 compliant authetication schemes.
 
Method Summary
 java.lang.String getID()
          Returns a String identifying the authentication challenge.
 java.lang.String getParameter(java.lang.String name)
          Returns authentication parameter with the given name, if available.
protected  java.util.Map getParameters()
          Returns authentication parameters map.
 java.lang.String getRealm()
          Returns authentication realm.
 
Methods inherited from class org.apache.commons.httpclient.auth.AuthSchemeBase
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RFC2617Scheme

public RFC2617Scheme(java.lang.String challenge)
              throws MalformedChallengeException
Default constructor for RFC2617 compliant authetication schemes.
Parameters:
challenge - authentication challenge
Throws:
MalformedChallengeException - is thrown if the authentication challenge is malformed
Method Detail

getParameters

protected java.util.Map getParameters()
Returns authentication parameters map. Keys in the map are lower-cased.
Returns:
the map of authentication parameters

getParameter

public java.lang.String getParameter(java.lang.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

getRealm

public java.lang.String getRealm()
Returns authentication realm. The realm may not be null.
Returns:
the authentication realm

getID

public java.lang.String getID()
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.

This method simply returns the realm for the challenge.

Returns:
String a String identifying the authentication challenge. The returned value may be null.


Copyright © 2001-2004 Apache Software Foundation. All Rights Reserved.