// maybe not as it implies session tracking
DigestAuthContext (Request request)
throws DigestAuthFilterException, ProtocolException
{
HttpCredential credential = null;
credential = (request.isProxy()
? request.getProxyAuthorization()
: request.getAuthorization());
if ( ! credential.getScheme().equalsIgnoreCase("Digest") ) {
String msg = ("Invalid authentication scheme \""
+ credential.getScheme()
+ " expecting \"Digest\"");
throw new DigestAuthFilterException (msg) ;
}
// now split things and decode things
dac_user = credential.getAuthParameter("username");
dac_uri = credential.getAuthParameter("uri");
dac_response = credential.getAuthParameter("response");
dac_realm = credential.getAuthParameter("realm");
dac_method = request.getMethod();
dac_nonce = credential.getAuthParameter("nonce");
if (dac_user == null || dac_uri == null || dac_response == null ||
dac_realm == null) {
String msg = ("Invalid authentication header");
throw new DigestAuthFilterException(msg);
}