org.acegisecurity.ui.rememberme
Class RememberMeProcessingFilter

java.lang.Object
  extended by org.acegisecurity.ui.rememberme.RememberMeProcessingFilter
All Implemented Interfaces:
javax.servlet.Filter, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationEventPublisherAware

public class RememberMeProcessingFilter
extends Object
implements javax.servlet.Filter, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationEventPublisherAware

Detects if there is no Authentication object in the SecurityContext, and populates it with a remember-me authentication token if a RememberMeServices implementation so requests.

Concrete RememberMeServices implementations will have their RememberMeServices.autoLogin(HttpServletRequest, HttpServletResponse) method called by this filter. The Authentication or null returned by that method will be placed into the SecurityContext. The AuthenticationManager will be used, so that any concurrent session management or other authentication-specific behaviour can be achieved. This is the same pattern as with other authentication mechanisms, which call the AuthenticationManager as part of their contract.

If authentication is successful, an InteractiveAuthenticationSuccessEvent will be published to the application context. No events will be published if authentication was unsuccessful, because this would generally be recorded via an AuthenticationManager-specific application event.

Do not use this class directly. Instead configure web.xml to use the FilterToBeanProxy.

Version:
$Id: RememberMeProcessingFilter.java 1948 2007-08-25 00:15:30Z benalex $
Author:
Ben Alex

Constructor Summary
RememberMeProcessingFilter()
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
          Does nothing - we rely on IoC lifecycle services instead.
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
           
 RememberMeServices getRememberMeServices()
           
 void init(javax.servlet.FilterConfig ignored)
          Does nothing - we rely on IoC lifecycle services instead.
 void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher eventPublisher)
           
 void setAuthenticationManager(AuthenticationManager authenticationManager)
           
 void setRememberMeServices(RememberMeServices rememberMeServices)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RememberMeProcessingFilter

public RememberMeProcessingFilter()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

destroy

public void destroy()
Does nothing - we rely on IoC lifecycle services instead.

Specified by:
destroy in interface javax.servlet.Filter

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws IOException,
                     javax.servlet.ServletException
Specified by:
doFilter in interface javax.servlet.Filter
Throws:
IOException
javax.servlet.ServletException

getRememberMeServices

public RememberMeServices getRememberMeServices()

init

public void init(javax.servlet.FilterConfig ignored)
          throws javax.servlet.ServletException
Does nothing - we rely on IoC lifecycle services instead.

Specified by:
init in interface javax.servlet.Filter
Parameters:
ignored - not used
Throws:
javax.servlet.ServletException - DOCUMENT ME!

setApplicationEventPublisher

public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher eventPublisher)
Specified by:
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAware

setAuthenticationManager

public void setAuthenticationManager(AuthenticationManager authenticationManager)

setRememberMeServices

public void setRememberMeServices(RememberMeServices rememberMeServices)


Copyright © 2004-2012 Interface21, Inc. All Rights Reserved.