@NotThreadSafe public class DigestScheme extends RFC2617Scheme
Credential charset is configured via the
AuthPNames.CREDENTIAL_CHARSET
parameter of the HTTP request.
Since the digest username is included as clear text in the generated
Authentication header, the charset of the username must be compatible
with the
http element charset
.
The following parameters can be used to customize the behavior of this class:
Constructor and Description |
---|
DigestScheme()
Default constructor for the digest authetication scheme.
|
Modifier and Type | Method and Description |
---|---|
org.apache.http.Header |
authenticate(Credentials credentials,
org.apache.http.HttpRequest request)
Produces a digest authorization string for the given set of
Credentials , method name and URI. |
static String |
createCnonce()
Creates a random cnonce value based on the current time.
|
String |
getSchemeName()
Returns textual designation of the digest authentication scheme.
|
boolean |
isComplete()
Tests if the Digest authentication process has been completed.
|
boolean |
isConnectionBased()
Returns false.
|
void |
overrideParamter(String name,
String value) |
void |
processChallenge(org.apache.http.Header header)
Processes the Digest challenge.
|
getParameter, getParameters, getRealm, parseChallenge
authenticate, isProxy, toString
public DigestScheme()
public void processChallenge(org.apache.http.Header header) throws MalformedChallengeException
processChallenge
in interface AuthScheme
processChallenge
in class AuthSchemeBase
header
- the challenge headerMalformedChallengeException
- is thrown if the authentication challenge
is malformedpublic boolean isComplete()
public String getSchemeName()
digest
public boolean isConnectionBased()
public org.apache.http.Header authenticate(Credentials credentials, org.apache.http.HttpRequest request) throws AuthenticationException
Credentials
, method name and URI.credentials
- A set of credentials to be used for athenticationrequest
- The request being authenticatedInvalidCredentialsException
- if authentication credentials
are not valid or not applicable for this authentication schemeAuthenticationException
- if authorization string cannot
be generated due to an authentication failurepublic static String createCnonce()
Copyright © 1999-2012 The Apache Software Foundation. All Rights Reserved.