SPT Core API

com.sptci.auth.digest
Class HttpDigestFilter

java.lang.Object
  extended by com.sptci.auth.Filter
      extended by com.sptci.auth.digest.HttpDigestFilter
All Implemented Interfaces:
Filter

public class HttpDigestFilter
extends Filter

A servlet filter that implements HTTP-Digest authentication. The username and password are retrieved from the persons.users table.

Copyright 2006, Sans Pareil Technologies, Inc.

Version:
$Id: HttpDigestFilter.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Rakesh Vidyadharan 2006-11-15

Field Summary
 
Fields inherited from class com.sptci.auth.Filter
filterConfig, logger, USER
 
Constructor Summary
HttpDigestFilter()
           
 
Method Summary
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
          Check the authentication credentials for the request.
 void init(FilterConfig filterConfig)
          Called by the web container to indicate to a filter that it is being placed into service.
 
Methods inherited from class com.sptci.auth.Filter
destroy, setFilterConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpDigestFilter

public HttpDigestFilter()
Method Detail

init

public void init(FilterConfig filterConfig)
          throws ServletException
Called by the web container to indicate to a filter that it is being placed into service. The servlet container calls the init method exactly once after instantiating the filter. The init method must complete successfully before the filter is asked to do any filtering work.

Initialises Filter.filterConfig and the digestServer with a new SecureRandom instance.

Specified by:
init in interface Filter
Overrides:
init in class Filter
Parameters:
filterConfig - - A reference to the configuration object used by the servlet container to pass information to the filter.
Throws:
ServletException - - If an exception is encountered while fetching the initialisation parameters from the specified filterConfig object reference.

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws IOException,
                     ServletException
Check the authentication credentials for the request. If the credentials are appropriate, chain the request on to the next servlet/filter in the chain, else throw a ServletException.

Specified by:
doFilter in interface Filter
Overrides:
doFilter in class Filter
Throws:
IOException - - If exceptions are encountered while applying the filter.
ServletException - - If exceptions are encountered while interacting with the request or response objects.
See Also:
getAuthenticator()

SPT Core API