org.telscenter.sail.webapp.presentation.web.filters
Class TelsAuthenticationProcessingFilter

java.lang.Object
  extended by org.springframework.security.ui.SpringSecurityFilter
      extended by org.springframework.security.ui.AbstractProcessingFilter
          extended by org.springframework.security.ui.webapp.AuthenticationProcessingFilter
              extended by net.sf.sail.webapp.presentation.web.filters.PasAuthenticationProcessingFilter
                  extended by org.telscenter.sail.webapp.presentation.web.filters.TelsAuthenticationProcessingFilter
All Implemented Interfaces:
javax.servlet.Filter, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationEventPublisherAware, org.springframework.context.MessageSourceAware, org.springframework.core.Ordered

public class TelsAuthenticationProcessingFilter
extends PasAuthenticationProcessingFilter

Custom AuthenticationProcessingFilter that subclasses Acegi Security. This filter upon successful authentication will retrieve a User and put it into the http session.

Version:
$Id$
Author:
Hiroki Terashima

Field Summary
static String ADMIN_DEFAULT_TARGET_PATH
           
static String LOGOUT_PATH
           
static Integer recentFailedLoginAttemptsLimit
           
static Integer recentFailedLoginTimeLimit
           
static String RESEARCHER_DEFAULT_TARGET_PATH
           
static String STUDENT_DEFAULT_TARGET_PATH
           
static String TEACHER_DEFAULT_TARGET_PATH
           
 
Fields inherited from class org.springframework.security.ui.webapp.AuthenticationProcessingFilter
SPRING_SECURITY_FORM_PASSWORD_KEY, SPRING_SECURITY_FORM_USERNAME_KEY, SPRING_SECURITY_LAST_USERNAME_KEY
 
Fields inherited from class org.springframework.security.ui.AbstractProcessingFilter
authenticationDetailsSource, eventPublisher, messages, SPRING_SECURITY_LAST_EXCEPTION_KEY, SPRING_SECURITY_SAVED_REQUEST_KEY
 
Fields inherited from class org.springframework.security.ui.SpringSecurityFilter
logger
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
TelsAuthenticationProcessingFilter()
           
 
Method Summary
protected  String determineFailureUrl(javax.servlet.http.HttpServletRequest request, org.springframework.security.AuthenticationException failed)
          Get the failure url.
 Properties getPortalProperties()
           
 UserDetailsService getUserDetailsService()
           
 void setPortalProperties(Properties portalProperties)
           
 void setPortalService(PortalService portalService)
           
 void setUserDetailsService(UserDetailsService userDetailsService)
           
protected  void successfulAuthentication(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.Authentication authResult)
           
protected  void unsuccessfulAuthentication(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.AuthenticationException failed)
          Called when the user fails to log in to the portal.
 
Methods inherited from class org.springframework.security.ui.webapp.AuthenticationProcessingFilter
attemptAuthentication, getDefaultFilterProcessesUrl, getOrder, obtainPassword, obtainUsername, setDetails, setPasswordParameter, setUsernameParameter
 
Methods inherited from class org.springframework.security.ui.AbstractProcessingFilter
afterPropertiesSet, determineTargetUrl, doFilterHttp, getAllowSessionCreation, getAuthenticationDetailsSource, getAuthenticationFailureUrl, getAuthenticationManager, getDefaultTargetUrl, getFilterProcessesUrl, getRememberMeServices, getTargetUrlResolver, obtainFullSavedRequestUrl, onPreAuthentication, onSuccessfulAuthentication, onUnsuccessfulAuthentication, requiresAuthentication, sendRedirect, setAllowSessionCreation, setAlwaysUseDefaultTargetUrl, setApplicationEventPublisher, setAuthenticationDetailsSource, setAuthenticationFailureUrl, setAuthenticationManager, setContinueChainBeforeSuccessfulAuthentication, setDefaultTargetUrl, setExceptionMappings, setFilterProcessesUrl, setInvalidateSessionOnSuccessfulAuthentication, setMessageSource, setMigrateInvalidatedSessionAttributes, setRememberMeServices, setServerSideRedirect, setSessionRegistry, setTargetUrlResolver, setUseRelativeContext
 
Methods inherited from class org.springframework.security.ui.SpringSecurityFilter
destroy, doFilter, init, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STUDENT_DEFAULT_TARGET_PATH

public static final String STUDENT_DEFAULT_TARGET_PATH
See Also:
Constant Field Values

TEACHER_DEFAULT_TARGET_PATH

public static final String TEACHER_DEFAULT_TARGET_PATH
See Also:
Constant Field Values

ADMIN_DEFAULT_TARGET_PATH

public static final String ADMIN_DEFAULT_TARGET_PATH
See Also:
Constant Field Values

RESEARCHER_DEFAULT_TARGET_PATH

public static final String RESEARCHER_DEFAULT_TARGET_PATH
See Also:
Constant Field Values

LOGOUT_PATH

public static final String LOGOUT_PATH
See Also:
Constant Field Values

recentFailedLoginTimeLimit

public static final Integer recentFailedLoginTimeLimit

recentFailedLoginAttemptsLimit

public static final Integer recentFailedLoginAttemptsLimit
Constructor Detail

TelsAuthenticationProcessingFilter

public TelsAuthenticationProcessingFilter()
Method Detail

successfulAuthentication

protected void successfulAuthentication(javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response,
                                        org.springframework.security.Authentication authResult)
                                 throws IOException,
                                        javax.servlet.ServletException
Overrides:
successfulAuthentication in class PasAuthenticationProcessingFilter
Throws:
IOException
javax.servlet.ServletException
See Also:
org.acegisecurity.ui.AbstractProcessingFilter#successfulAuthentication(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.acegisecurity.Authentication)

unsuccessfulAuthentication

protected void unsuccessfulAuthentication(javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response,
                                          org.springframework.security.AuthenticationException failed)
                                   throws IOException,
                                          javax.servlet.ServletException
Called when the user fails to log in to the portal. This function updates the recent failed login time and recent failed number of attempts.

Overrides:
unsuccessfulAuthentication in class org.springframework.security.ui.AbstractProcessingFilter
Throws:
IOException
javax.servlet.ServletException
See Also:
AbstractProcessingFilter.unsuccessfulAuthentication(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.security.AuthenticationException)

determineFailureUrl

protected String determineFailureUrl(javax.servlet.http.HttpServletRequest request,
                                     org.springframework.security.AuthenticationException failed)
Get the failure url. This function checks if the public and private keys for the captcha have been provided and if the user has failed to log in 5 or more times in the last 15 minutes. If so, it will require the failure url page to display a captcha.

Overrides:
determineFailureUrl in class org.springframework.security.ui.AbstractProcessingFilter
See Also:
AbstractProcessingFilter.determineFailureUrl(javax.servlet.http.HttpServletRequest, org.springframework.security.AuthenticationException)

getUserDetailsService

public UserDetailsService getUserDetailsService()
Returns:
the userDetailsService

setUserDetailsService

public void setUserDetailsService(UserDetailsService userDetailsService)
Parameters:
userDetailsService - the userDetailsService to set

setPortalService

public void setPortalService(PortalService portalService)
Parameters:
portalService - the portalService to set

getPortalProperties

public Properties getPortalProperties()
Returns:

setPortalProperties

public void setPortalProperties(Properties portalProperties)
Parameters:
portalProperties -


Copyright © 2012. All Rights Reserved.