org.restlet.data

## Class ChallengeRequest

- java.lang.Object
- - org.restlet.data.ChallengeMessage
  - - org.restlet.data.ChallengeRequest

    public final class ChallengeRequest
    extends ChallengeMessage

Authentication challenge sent by an origin server to a client. Upon reception of this request, the client should send a new request with the proper `ChallengeResponse` set.
Note that when used with HTTP connectors, this class maps to the "WWW-Authenticate" header.

Author:
  Jerome Louvel

### Field Summary

### Fields inherited from class org.restlet.data.ChallengeMessage

`QUALITY_AUTHENTICATION, QUALITY_AUTHENTICATION_INTEGRITY`

### Constructor Summary

Constructors
Constructor and Description
`ChallengeRequest(ChallengeScheme scheme)` Constructor.
`ChallengeRequest(ChallengeScheme scheme, java.lang.String realm)` Constructor.

### Method Summary

Methods
`boolean` `equals(java.lang.Object obj)`
`java.util.List<Reference>` `getDomainRefs()` Returns the base URI references that collectively define the protected domains for the digest authentication.
`java.util.List<java.lang.String>` `getQualityOptions()` Returns the available options for quality of protection.
`boolean` `isStale()` Indicates if the previous request from the client was stale.
`void` `setDomainRefs(java.util.List<Reference> domainRefs)` Sets the URI references that define the protection domains for the digest authentication.
`void` `setDomainUris(java.util.Collection<java.lang.String> domainUris)` Sets the URI references that define the protection domains for the digest authentication.
`void` `setQualityOptions(java.util.List<java.lang.String> qualityOptions)` Sets the available options for quality of protection.
`void` `setStale(boolean stale)` Indicates if the previous request from the client was stale.

### Methods inherited from class org.restlet.data.ChallengeMessage

`getDigestAlgorithm, getOpaque, getParameters, getRawValue, getRealm, getScheme, getServerNonce, hashCode, setDigestAlgorithm, setOpaque, setParameters, setRawValue, setRealm, setScheme, setServerNonce`

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

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

### Constructor Detail

#### ChallengeRequest

    public ChallengeRequest(ChallengeScheme scheme)

Constructor.

Parameters:
  `scheme` - The challenge scheme.

#### ChallengeRequest

    public ChallengeRequest(ChallengeScheme scheme,
                    java.lang.String realm)

Constructor.

Parameters:
  `scheme` - The challenge scheme.
  `realm` - The authentication realm.

### Method Detail

#### equals

    public boolean equals(java.lang.Object obj)

Overrides:
  `equals` in class `java.lang.Object`

#### getDomainRefs

    public java.util.List<Reference> getDomainRefs()

Returns the base URI references that collectively define the protected domains for the digest authentication. By default it return a list with a single "/" URI reference.

Returns:
  The base URI references.

#### getQualityOptions

    public java.util.List<java.lang.String> getQualityOptions()

Returns the available options for quality of protection. The default value is `ChallengeMessage.QUALITY_AUTHENTICATION`.

Returns:
  The available options for quality of protection.

#### isStale

    public boolean isStale()

Indicates if the previous request from the client was stale.

Returns:
  True if the previous request from the client was stale.

#### setDomainRefs

    public void setDomainRefs(java.util.List<Reference> domainRefs)

Sets the URI references that define the protection domains for the digest authentication.

Parameters:
  `domainRefs` - The base URI references.

#### setDomainUris

    public void setDomainUris(java.util.Collection<java.lang.String> domainUris)

Sets the URI references that define the protection domains for the digest authentication. Note that the parameters are copied into a new `CopyOnWriteArrayList` instance.

Parameters:
  `domainUris` - The base URI references.
See Also:
  `setDomainRefs(List)`

#### setQualityOptions

    public void setQualityOptions(java.util.List<java.lang.String> qualityOptions)

Sets the available options for quality of protection. The default value is `ChallengeMessage.QUALITY_AUTHENTICATION`.

Parameters:
  `qualityOptions` - The available options for quality of protection.

#### setStale

    public void setStale(boolean stale)

Indicates if the previous request from the client was stale.

Parameters:
  `stale` - True if the previous request from the client was stale.