com.sptci.auth.digest
Class HttpDigestFilter
java.lang.Object
com.sptci.auth.Filter
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpDigestFilter
public HttpDigestFilter()
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()