|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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(java.lang.String challenge)
Constructor for the digest authentication scheme. |
Method Summary | |
java.lang.String |
authenticate(Credentials credentials,
java.lang.String method,
java.lang.String uri)
Produces a digest authorization string for the given set of Credentials , method name and URI. |
static java.lang.String |
authenticate(UsernamePasswordCredentials credentials,
java.util.Map params)
Produces a digest authorization string for the given set of UsernamePasswordCredentials and authetication parameters. |
static java.lang.String |
createCnonce()
Creates a random cnonce value based on the current time. |
static java.lang.String |
createDigest(java.lang.String uname,
java.lang.String pwd,
java.util.Map params)
Creates an MD5 response digest. |
static java.lang.String |
createDigestHeader(java.lang.String uname,
java.util.Map params,
java.lang.String digest)
Creates digest-response header as defined in RFC2617. |
java.lang.String |
getID()
Gets an ID based upon the realm and the nonce value. |
java.lang.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 |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DigestScheme(java.lang.String challenge) throws MalformedChallengeException
challenge
- The authentication challenge
MalformedChallengeException
- is thrown if the authentication challenge
is malformedMethod Detail |
public java.lang.String getID()
getID
in interface AuthScheme
getID
in class RFC2617Scheme
public java.lang.String getSchemeName()
digest
public java.lang.String authenticate(Credentials credentials, java.lang.String method, java.lang.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 java.lang.String authenticate(UsernamePasswordCredentials credentials, java.util.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 java.lang.String createDigest(java.lang.String uname, java.lang.String pwd, java.util.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 java.lang.String createDigestHeader(java.lang.String uname, java.util.Map params, java.lang.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 java.lang.String createCnonce() throws AuthenticationException
AuthenticationException
- if MD5 algorithm is not supported.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |