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 credential charset parameter. 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 notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.
/* * Copyright (C) 2006 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
Public Member Functions | |
DigestScheme () | |
Default constructor for the digest authetication scheme. | |
void | processChallenge (final Header header) throws MalformedChallengeException |
Processes the Digest challenge. More... | |
boolean | isComplete () |
Tests if the Digest authentication process has been completed. More... | |
String | getSchemeName () |
Returns textual designation of the digest authentication scheme. More... | |
boolean | isConnectionBased () |
Returns false . More... | |
Header | authenticate (final Credentials credentials, final HttpRequest request) throws AuthenticationException |
Produces a digest authorization string for the given set of com.good.gd.apache.http.auth.Credentials, method name and URI. More... | |
Public Member Functions inherited from RFC2617Scheme | |
RFC2617Scheme () | |
Default constructor for RFC2617 compliant authetication schemes. | |
String | getParameter (final String name) |
Returns authentication parameter with the given name, if available. More... | |
String | getRealm () |
Returns authentication realm. More... | |
Public Member Functions inherited from AuthSchemeBase | |
boolean | isProxy () |
Returns true if authenticating against a proxy, false otherwise. More... | |
Static Public Member Functions | |
static String | createCnonce () |
Creates a random cnonce value based on the current time. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from RFC2617Scheme | |
Map< String, String > | getParameters () |
Returns authentication parameters map. More... | |
void processChallenge | ( | final Header | header | ) | throws MalformedChallengeException |
header | the challenge header |
MalformedChallengeException | is thrown if the authentication challenge is malformed |
Reimplemented from AuthSchemeBase.
boolean isComplete | ( | ) |
true
if Digest authorization has been processed, false
otherwise. Implements AuthScheme.
String getSchemeName | ( | ) |
digest
Implements AuthScheme.
boolean isConnectionBased | ( | ) |
Header authenticate | ( | final Credentials | credentials, |
final HttpRequest | request | ||
) | throws AuthenticationException |
credentials | A set of credentials to be used for athentication |
request | The request being authenticated |
org.apache.http.auth.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 failure |
Implements AuthScheme.
|
static |
UnsupportedDigestAlgorithmException | if MD5 algorithm is not supported. |