org.apache.catalina.authenticator
public class DigestAuthenticator extends AuthenticatorBase
Version: $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (Tue, 24 Oct 2006) $
Field Summary | |
---|---|
protected int | cnonceCacheSize
Maximum number of client nonces to keep in the cache. |
protected Map<String,DigestAuthenticator.NonceInfo> | cnonces
List of the client nonce values currently being tracked |
protected static String | info
Descriptive information about this implementation. |
protected String | key
Private key. |
protected static MD5Encoder | md5Encoder
The MD5 helper object for this class. |
protected static MessageDigest | md5Helper
MD5 message digest provider. |
protected long | nonceValidity
How long server nonces are valid for in milliseconds. |
protected String | opaque
Opaque Sting opaque; |
protected static String | QOP
Tomcat's DIGEST implementation only supports auth quality of protection |
protected boolean | validateUri
Should the URI be validated as required by RFC2617? |
Constructor Summary | |
---|---|
DigestAuthenticator() |
Method Summary | |
---|---|
protected String | generateNonce(Request request)
Generate a unique token. |
int | getCnonceCacheSize() |
String | getKey() |
long | getNonceValidity() |
String | getOpaque() |
boolean | isValidateUri() |
protected String | parseUsername(String authorization)
Parse the username from the specified authorization string. |
protected static String | removeQuotes(String quotedString, boolean quotesRequired)
Removes the quotes on a string. |
protected static String | removeQuotes(String quotedString)
Removes the quotes on a string. |
protected void | setAuthenticateHeader(Request request, Response response, LoginConfig config, String nonce, boolean isNonceStale)
Generates the WWW-Authenticate header.
|
void | setCnonceCacheSize(int cnonceCacheSize) |
void | setKey(String key) |
void | setNonceValidity(long nonceValidity) |
void | setOpaque(String opaque) |
void | setValidateUri(boolean validateUri) |
Parameters: request HTTP Servlet request
null
Parameters: authorization Authorization string to be parsed
The header MUST follow this template :
WWW-Authenticate = "WWW-Authenticate" ":" "Digest" digest-challenge digest-challenge = 1#( realm | [ domain ] | nonce | [ digest-opaque ] |[ stale ] | [ algorithm ] ) realm = "realm" "=" realm-value realm-value = quoted-string domain = "domain" "=" <"> 1#URI <"> nonce = "nonce" "=" nonce-value nonce-value = quoted-string opaque = "opaque" "=" quoted-string stale = "stale" "=" ( "true" | "false" ) algorithm = "algorithm" "=" ( "MD5" | token )
Parameters: request HTTP Servlet request response HTTP Servlet response config Login configuration describing how authentication should be performed nonce nonce token