RFC2617Scheme (HttpClient Library (Version 3.1))
Date: 2019-09-02

org.apache.commons.httpclient.auth

## Class RFC2617Scheme

- java.lang.Object
- - org.apache.commons.httpclient.auth.RFC2617Scheme

- All Implemented Interfaces:
    AuthScheme
  Direct Known Subclasses:
    BasicScheme, DigestScheme

      public abstract class RFC2617Scheme
      extends java.lang.Object
      implements AuthScheme

  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

    Constructors
    Constructor and Description
    `RFC2617Scheme()` Default constructor for RFC2617 compliant authetication schemes.
    `RFC2617Scheme(java.lang.String challenge)` Deprecated. Use parameterless constructor and `AuthScheme.processChallenge(String)` method

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getID()` Deprecated. no longer used
    `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.
    `void` | `processChallenge(java.lang.String challenge)` Processes the given challenge token.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.commons.httpclient.auth.AuthScheme

      `authenticate, authenticate, getSchemeName, isComplete, isConnectionBased`

- - ### Constructor Detail

    - #### RFC2617Scheme

          public RFC2617Scheme()

      Default constructor for RFC2617 compliant authetication schemes.
      Since:
        3.0

    - #### RFC2617Scheme

          public RFC2617Scheme(java.lang.String challenge)
                        throws MalformedChallengeException

      Deprecated. Use parameterless constructor and `AuthScheme.processChallenge(String)` method
      Default constructor for RFC2617 compliant authetication schemes.
      Parameters:
        `challenge` - authentication challenge
      Throws:
        `MalformedChallengeException` - is thrown if the authentication challenge is malformed

  - ### Method Detail

    - #### processChallenge

          public void processChallenge(java.lang.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
      Specified by:
        `processChallenge` in interface `AuthScheme`
      Parameters:
        `challenge` - the challenge string
      Throws:
        `MalformedChallengeException` - is thrown if the authentication challenge is malformed
      Since:
        3.0

    - #### 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.
      Specified by:
        `getParameter` in interface `AuthScheme`
      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.
      Specified by:
        `getRealm` in interface `AuthScheme`
      Returns:
        the authentication realm

    - #### getID

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

      This method simply returns the realm for the challenge.

      Specified by:
        `getID` in interface `AuthScheme`
      Returns:
        String a String identifying the authentication challenge. The returned value may be null.

Copyright (c) 1999-2005 - Apache Software Foundation