|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.impl.auth.AuthSchemeBase
org.apache.http.impl.auth.RFC2617Scheme
org.apache.http.impl.auth.DigestScheme
@NotThreadSafe public class DigestScheme
Digest authentication scheme as defined in RFC 2617. Both MD5 (default) and MD5-sess are supported. Currently only qop=auth or no qop is supported. qop=auth-int is unsupported. If auth and auth-int are provided, auth is used.
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 Summary | |
---|---|
DigestScheme()
Default constructor for the digest authetication scheme. |
Method Summary | |
---|---|
Header |
authenticate(Credentials credentials,
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(Header header)
Processes the Digest challenge. |
Methods inherited from class org.apache.http.impl.auth.RFC2617Scheme |
---|
getParameter, getParameters, getRealm, parseChallenge |
Methods inherited from class org.apache.http.impl.auth.AuthSchemeBase |
---|
isProxy, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DigestScheme()
Method Detail |
---|
public void processChallenge(Header header) throws MalformedChallengeException
processChallenge
in interface AuthScheme
processChallenge
in class AuthSchemeBase
header
- the challenge header
MalformedChallengeException
- is thrown if the authentication challenge
is malformedpublic boolean isComplete()
public String getSchemeName()
digest
public boolean isConnectionBased()
public void overrideParamter(String name, String value)
public Header authenticate(Credentials credentials, HttpRequest request) throws AuthenticationException
Credentials
, method name and URI.
credentials
- A set of credentials to be used for athenticationrequest
- The request being authenticated
InvalidCredentialsException
- if authentication credentials
are not valid or not applicable for this authentication scheme
AuthenticationException
- if authorization string cannot
be generated due to an authentication failurepublic static String createCnonce()
UnsupportedDigestAlgorithmException
- if MD5 algorithm is not supported.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |