org.efaps.ui.filter
Class BasicAuthenticationFilter

java.lang.Object
  extended by org.efaps.ui.filter.AbstractFilter
      extended by org.efaps.ui.filter.AbstractAuthenticationFilter
          extended by org.efaps.ui.filter.BasicAuthenticationFilter
All Implemented Interfaces:
javax.servlet.Filter

public class BasicAuthenticationFilter
extends AbstractAuthenticationFilter

The filter is used to make basic access authentication defined in RFC 2617.

Version:
$Id: BasicAuthenticationFilter.java 3447 2009-11-29 22:46:39Z tim.moxter $
Author:
tmo

Constructor Summary
BasicAuthenticationFilter()
           
 
Method Summary
protected  void doAuthenticate(javax.servlet.http.HttpServletRequest _request, javax.servlet.http.HttpServletResponse _response, javax.servlet.FilterChain _chain)
          If the user does not make authentication, the header for basic authentication is sent to the client.
 void init(javax.servlet.FilterConfig _filterConfig)
          Called by the web container to indicate to a filter that it is being placed into service.
 
Methods inherited from class org.efaps.ui.filter.AbstractAuthenticationFilter
checkLogin, destroy, doFilter
 
Methods inherited from class org.efaps.ui.filter.AbstractFilter
doFilter, getLoggedInUser, isLoggedIn, setLoggedInUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicAuthenticationFilter

public BasicAuthenticationFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig _filterConfig)
          throws javax.servlet.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. The web container cannot place the filter into service if the init method either 1.Throws a ServletException 2.Does not return within a time period defined by the web container

Specified by:
init in interface javax.servlet.Filter
Overrides:
init in class AbstractAuthenticationFilter
Parameters:
_filterConfig - filter configuration instance
Throws:
javax.servlet.ServletException - on error
See Also:
INIT_PARAM_TITLE, title, AbstractAuthenticationFilter.INIT_PARAM_APPLICATION, #loginhandler

doAuthenticate

protected void doAuthenticate(javax.servlet.http.HttpServletRequest _request,
                              javax.servlet.http.HttpServletResponse _response,
                              javax.servlet.FilterChain _chain)
                       throws java.io.IOException,
                              javax.servlet.ServletException
If the user does not make authentication, the header for basic authentication is sent to the client. After the client makes the authentication, the name and password is checked with method AbstractAuthenticationFilter.checkLogin(java.lang.String, java.lang.String).
If the authentication fails, the header for basic authentication is sent again to the used, otherwise the nothing is filtered anymore.

Specified by:
doAuthenticate in class AbstractAuthenticationFilter
Parameters:
_request - HttpServletRequest
_response - HttpServletResponse
_chain - FilterChain
Throws:
java.io.IOException - on error
javax.servlet.ServletException - on error
See Also:
AbstractAuthenticationFilter.doAuthenticate(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain)


Copyright © 2003-2010 The eFaps Team. All Rights Reserved.