winstone.auth
Class DigestAuthenticationHandler

java.lang.Object
  extended by winstone.auth.BaseAuthenticationHandler
      extended by winstone.auth.DigestAuthenticationHandler
All Implemented Interfaces:
AuthenticationHandler

public class DigestAuthenticationHandler
extends BaseAuthenticationHandler

Implements the MD5 digest version of authentication

Version:
$Id: DigestAuthenticationHandler.java,v 1.3 2004/05/22 06:53:45 rickknowles Exp $
Author:
Rick Knowles

Field Summary
 
Fields inherited from class winstone.auth.BaseAuthenticationHandler
AUTH_RESOURCES, constraints, realm, realmName
 
Constructor Summary
DigestAuthenticationHandler(org.w3c.dom.Node loginConfigNode, java.util.List constraintNodes, java.util.Set rolesAllowed, AuthenticationRealm realm)
           
 
Method Summary
 java.lang.String md5Encode(java.lang.String input)
          Returns a hex encoded MD5 digested version of the input string
protected  void requestAuthentication(HttpServletRequest request, HttpServletResponse response, java.lang.String pathRequested)
          Call this once we know that we need to authenticate
protected  boolean validatePossibleAuthenticationResponse(HttpServletRequest request, HttpServletResponse response, java.lang.String pathRequested)
          Handling the (possible) response
 
Methods inherited from class winstone.auth.BaseAuthenticationHandler
doRoleCheck, processAuthentication, setNoCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DigestAuthenticationHandler

public DigestAuthenticationHandler(org.w3c.dom.Node loginConfigNode,
                                   java.util.List constraintNodes,
                                   java.util.Set rolesAllowed,
                                   AuthenticationRealm realm)
                            throws java.security.NoSuchAlgorithmException
Throws:
java.security.NoSuchAlgorithmException
Method Detail

requestAuthentication

protected void requestAuthentication(HttpServletRequest request,
                                     HttpServletResponse response,
                                     java.lang.String pathRequested)
                              throws java.io.IOException
Call this once we know that we need to authenticate

Specified by:
requestAuthentication in class BaseAuthenticationHandler
Throws:
java.io.IOException

validatePossibleAuthenticationResponse

protected boolean validatePossibleAuthenticationResponse(HttpServletRequest request,
                                                         HttpServletResponse response,
                                                         java.lang.String pathRequested)
                                                  throws java.io.IOException
Handling the (possible) response

Specified by:
validatePossibleAuthenticationResponse in class BaseAuthenticationHandler
Returns:
True if the request should continue, or false if we have intercepted it
Throws:
java.io.IOException

md5Encode

public java.lang.String md5Encode(java.lang.String input)
                           throws java.io.UnsupportedEncodingException
Returns a hex encoded MD5 digested version of the input string

Parameters:
input - The string to encode
Returns:
MD5 digested, hex encoded version of the input
Throws:
java.io.UnsupportedEncodingException


Copyright © 2013. All Rights Reserved.