org.efaps.ui.filter
Class FormBasedAuthenticationFilter

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

public class FormBasedAuthenticationFilter
extends AbstractAuthenticationFilter

Version:
$Id: FormBasedAuthenticationFilter.java 1367 2007-09-22 12:25:31Z tmo $
Author:
tmo

Field Summary
static java.lang.String INIT_PARAM_LOGIN_PARAM_NAME
           
static java.lang.String INIT_PARAM_LOGIN_PARAM_PASSWORD
           
static java.lang.String INIT_PARAM_URL_IGNORE
          The string is name of the parameter used to define the url where unprotected content lies.
static java.lang.String INIT_PARAM_URL_LOGIN
          The string is name of the parameter used to define the url login used to authenticate.
static java.lang.String INIT_PARAM_URL_LOGIN_PAGE
          The string is name of the parameter used to define the url login page.
static java.lang.String INIT_PARAM_URL_LOGOUT
          The string is name of the parameter used to define the url login used to authenticate.
static java.lang.String SESSIONPARAM_LOGIN_FORWARD
          Name of the session variable for the login forward (after the login is done this is the next page).
 
Constructor Summary
FormBasedAuthenticationFilter()
           
 
Method Summary
protected  void doAuthenticate(javax.servlet.http.HttpServletRequest _request, javax.servlet.http.HttpServletResponse _response, javax.servlet.FilterChain _chain)
          Authentication method.
protected  void doFilter(javax.servlet.http.HttpServletRequest _request, javax.servlet.http.HttpServletResponse _response, javax.servlet.FilterChain _chain)
          If the current user is already logged in, nothing is filtered.
protected  void doSendLoginFrameNotCorrect(javax.servlet.http.HttpServletRequest _req, javax.servlet.http.HttpServletResponse _res)
          This page is sent if the login is not correct.
 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
 
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
 

Field Detail

SESSIONPARAM_LOGIN_FORWARD

public static final java.lang.String SESSIONPARAM_LOGIN_FORWARD
Name of the session variable for the login forward (after the login is done this is the next page).

See Also:
Constant Field Values

INIT_PARAM_URL_LOGIN_PAGE

public static final java.lang.String INIT_PARAM_URL_LOGIN_PAGE
The string is name of the parameter used to define the url login page.

See Also:
init(javax.servlet.FilterConfig), Constant Field Values

INIT_PARAM_URL_IGNORE

public static final java.lang.String INIT_PARAM_URL_IGNORE
The string is name of the parameter used to define the url where unprotected content lies.

See Also:
init(javax.servlet.FilterConfig), Constant Field Values

INIT_PARAM_URL_LOGIN

public static final java.lang.String INIT_PARAM_URL_LOGIN
The string is name of the parameter used to define the url login used to authenticate.

See Also:
init(javax.servlet.FilterConfig), Constant Field Values

INIT_PARAM_URL_LOGOUT

public static final java.lang.String INIT_PARAM_URL_LOGOUT
The string is name of the parameter used to define the url login used to authenticate.

See Also:
init(javax.servlet.FilterConfig), Constant Field Values

INIT_PARAM_LOGIN_PARAM_NAME

public static final java.lang.String INIT_PARAM_LOGIN_PARAM_NAME
See Also:
Constant Field Values

INIT_PARAM_LOGIN_PARAM_PASSWORD

public static final java.lang.String INIT_PARAM_LOGIN_PARAM_PASSWORD
See Also:
Constant Field Values
Constructor Detail

FormBasedAuthenticationFilter

public FormBasedAuthenticationFilter()
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

doFilter

protected void doFilter(javax.servlet.http.HttpServletRequest _request,
                        javax.servlet.http.HttpServletResponse _response,
                        javax.servlet.FilterChain _chain)
                 throws java.io.IOException,
                        javax.servlet.ServletException
If the current user is already logged in, nothing is filtered.

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

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
Description copied from class: AbstractAuthenticationFilter
Authentication method.

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:
doSendLoginFrameNotCorrect(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

doSendLoginFrameNotCorrect

protected void doSendLoginFrameNotCorrect(javax.servlet.http.HttpServletRequest _req,
                                          javax.servlet.http.HttpServletResponse _res)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
This page is sent if the login is not correct.

Parameters:
_req - HttpServletRequest that encapsulates the request to the servlet
_res - HttpServletResponse that encapsulates the response from the servlet
Throws:
javax.servlet.ServletException
java.io.IOException


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