|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.httpclient.auth.AuthSchemeBase | +--org.apache.commons.httpclient.auth.RFC2617Scheme | +--org.apache.commons.httpclient.auth.DigestScheme
Digest authentication scheme as defined in RFC 2617.
Constructor Summary | |
DigestScheme(String challenge)
Constructor for the digest authentication scheme. |
Method Summary | |
String |
authenticate(Credentials credentials,
String method,
String uri)
Produces a digest authorization string for the given set of Credentials , method name and URI. |
static String |
authenticate(UsernamePasswordCredentials credentials,
Map params)
Produces a digest authorization string for the given set of UsernamePasswordCredentials and authetication parameters. |
static String |
createCnonce()
Creates a random cnonce value based on the current time. |
static String |
createDigest(String uname,
String pwd,
Map params)
Creates an MD5 response digest. |
static String |
createDigestHeader(String uname,
Map params,
String digest)
Creates digest-response header as defined in RFC2617. |
String |
getID()
Gets an ID based upon the realm and the nonce value. |
String |
getSchemeName()
Returns textual designation of the digest authentication scheme. |
Methods inherited from class org.apache.commons.httpclient.auth.RFC2617Scheme |
getParameter, getParameters, getRealm |
Methods inherited from class org.apache.commons.httpclient.auth.AuthSchemeBase |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public DigestScheme(String challenge) throws MalformedChallengeException
challenge
- The authentication challengeMalformedChallengeException
- is thrown if the authentication challenge
is malformedMethod Detail |
public String getID()
getID
in class RFC2617Scheme
public String getSchemeName()
digest
public String authenticate(Credentials credentials, String method, String uri) throws AuthenticationException
Credentials
, method name and URI.credentials
- A set of credentials to be used for athenticationmethod
- the name of the method that requires authorization.uri
- The URI for which authorization is needed.AuthenticationException
- if authorization string cannot
be generated due to an authentication failureHttpMethod.getName()
,
HttpMethod.getPath()
public static String authenticate(UsernamePasswordCredentials credentials, Map params) throws AuthenticationException
UsernamePasswordCredentials
and authetication parameters.credentials
- Credentials to create the digest withparams
- The authetication parameters. The following
parameters are expected: uri
, realm
,
nonce
, nc
, cnonce
,
qop
, methodname
.AuthenticationException
- if authorization string cannot
be generated due to an authentication failurepublic static String createDigest(String uname, String pwd, Map params) throws AuthenticationException
uname
- Usernamepwd
- Passwordparams
- The parameters necessary to construct the digest.
The following parameters are expected: uri
,
realm
, nonce
, nc
,
cnonce
, qop
, methodname
.AuthenticationException
- when MD5 is an unsupported algorithmpublic static String createDigestHeader(String uname, Map params, String digest)
uname
- Usernameparams
- The parameters necessary to construct the digest header.
The following parameters are expected: uri
,
realm
, nonce
, nc
,
cnonce
, qop
, methodname
.digest
- The response tag's value as String.public static String createCnonce() throws AuthenticationException
AuthenticationException
- if MD5 algorithm is not supported.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |