public class DigestChallenge
extends java.lang.Object
WWW-Authenticate HTTP header.
WWW-Authenticate headerWWW-Authenticate response header. The header includes one or more
challenges, some of which may be HTTP Digest challenges.
To parse a HTTP Digest challenge pass it to the parse(String) method. Note that the
HTTP Digest challenge must first be extracted from the header value if the header contains
multiple challenges.
qop and realm directives are parsed but not stored.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
HTTP_HEADER_WWW_AUTHENTICATE
Name of the HTTP response header containing the challenge.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAlgorithm()
Returns the value of the algorithm directive if present, or its default value "MD5" if
not present.
|
java.lang.String |
getNonce()
Returns the unquoted version of the mandatory nonce directive.
|
java.lang.String |
getOpaque()
Returns the unquoted version of the opaque directive, or
null if the directive
is not present. |
java.lang.String |
getQuotedNonce()
Returns the quoted version of the mandatory nonce directive, exactly as it appears
in the challenge.
|
java.lang.String |
getQuotedOpaque()
Returns the quoted version of the opaque directive exactly as it appears in the
challenge, or
null if the directive is not present. |
java.lang.String |
getQuotedRealm()
Returns the quoted version of the mandatory realm directive, exactly as it appears
in the challenge.
|
java.lang.String |
getRealm()
Returns the unquoted version of the mandatory realm directive.
|
boolean |
isStale()
Returns a boolean representation of the stale directive.
|
static DigestChallenge |
parse(java.lang.String challengeString)
Parses a HTTP Digest challenge.
|
public static final java.lang.String HTTP_HEADER_WWW_AUTHENTICATE
public static DigestChallenge parse(java.lang.String challengeString)
challengeString - the challenge as a stringnull if the string does not contain a challenge or it
could not be parsedpublic java.lang.String getQuotedRealm()
public java.lang.String getRealm()
public java.lang.String getAlgorithm()
public java.lang.String getQuotedNonce()
The contents of the nonce are implementation dependent. The quality of the implementation depends on a good choice. […]
The nonce is opaque to the client.
public java.lang.String getNonce()
The contents of the nonce are implementation dependent. The quality of the implementation depends on a good choice. […]
The nonce is opaque to the client.
public java.lang.String getQuotedOpaque()
null if the directive is not present.
The opaque directive is described in
Section 3.2.1 of RFC 2617:
null if the
opaque directive is not present in the headerpublic java.lang.String getOpaque()
null if the directive
is not present.
The opaque directive is described in
Section 3.2.1 of RFC 2617:
null if the
opaque directive is not present in the headerpublic boolean isStale()
true if the header has a stale directive that is equal to "true"
(case-insensitive). If there is no stale directive or it has any other value, false
is returned.
The stale directive is described in
Section 3.2.1 of RFC 2617:
true if a stale directive is present in the header and equal to "true"
(case-insensitive), false otherwise.