I have configured the AuthenticationProcessingFilter to use NullRememberMeServices. I assume this means a user can not be authenticated based on the presence of a cookie. This is strange because if a user is logged in and I reload the application or restart Tomcat, the user is still authenticated. I am thinking this is the same reason why when a user has just changed their password, they are not able to view another secure page even if it allows ROLE_ANONYMOUS to view it.
Does anybody have an idea what i can do to fix this?
application context for acegi beans:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<description>
Contains the beans declarations for the acegi security system for spring objects.
</description>
<bean id="httpSessionContextIntegrationFilter" class="net.sf.acegisecurity.context.HttpSessionContextIntegrationFilter">
<property name="context"><value>net.sf.acegisecurity.context.security.SecureContextImpl</value></property>
</bean>
<bean id="authenticationProcessingFilter" class="com.ccg.security.CcgAuthenticationProcessingFilter">
<property name="authenticationManager"><ref bean="authenticationManager"/></property>
<property name="rememberMeServices"><ref bean="rememberMeServices"/></property>
<property name="authenticationFailureUrl"><value>/signon.html?error=1</value></property>
<property name="defaultTargetUrl"><value>/client_select.html</value></property>
<property name="filterProcessesUrl"><value>/j_acegi_security_check</value></property>
</bean>
<bean id="securityEnforcementFilter" class="net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter">
<property name="filterSecurityInterceptor"><ref bean="filterInvocationInterceptor"/></property>
<property name="authenticationEntryPoint"><ref bean="authenticationEntryPoint"/></property>
<property name="authenticationTrustResolver"><ref bean="authenticationTrustResolver"/></property>
</bean>
<bean id="authenticationEntryPoint" class="net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint">
<property name="loginFormUrl"><value>/signon.html</value></property>
<property name="forceHttps"><value>false</value></property>
</bean>
<bean id="authenticationTrustResolver" class="net.sf.acegisecurity.AuthenticationTrustResolverImpl"/>
<!-- remember me services should do nothing at this point -->
<bean id="rememberMeServices" class="net.sf.acegisecurity.ui.rememberme.NullRememberMeServices"/>
<!-- Filter Invocation Interceptor -->
<bean id="filterInvocationInterceptor" class="net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor">
<property name="authenticationManager"><ref bean="authenticationManager"/></property>
<property name="accessDecisionManager"><ref local="httpRequestAccessDecisionManager"/></property>
<!-- <property name="accessDecisionManager"><ref bean="accessDecisionManager"/></property> -->
<!-- <property name="runAsManager"><ref bean="runAsManager"/></property> -->
<property name="objectDefinitionSource">
<!--
Define secure access properties here
*Note: top most properties overide bottom most
-->
<value>
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/signon.html*=ROLE_USER,ROLE_ANONYMOUS
/welcome.html=ROLE_USER,ROLE_ANONYMOUS
/reference.html=ROLE_USER,ROLE_ANONYMOUS
/images/**=ROLE_USER,ROLE_ANONYMOUS
/styles/**=ROLE_USER,ROLE_ANONYMOUS
/scripts/**=ROLE_USER,ROLE_ANONYMOUS
/**=ROLE_USER
</value>
</property>
</bean>
<!-- Authentication manager -->
<bean id="authenticationManager" class="net.sf.acegisecurity.providers.ProviderManager">
<property name="providers">
<list>
<ref bean="daoAuthenticationProvider"/>
<ref bean="anonymousAuthenticationProvider"/>
</list>
</property>
</bean>
<!-- HTTP Request Access Decision Manager - Determiner for HTTP request access. Right now, all we need is one vote to allow access. -->
<bean id="httpRequestAccessDecisionManager" class="net.sf.acegisecurity.vote.AffirmativeBased">
<property name="allowIfAllAbstainDecisions"><value>false</value></property>
<property name="decisionVoters">
<list>
<ref bean="roleVoter"/>
</list>
</property>
</bean>
<!-- Authorization Related Beans -->
<bean id="roleVoter" class="net.sf.acegisecurity.vote.RoleVoter"/>
<!-- DAO Authentication Provider - Acesses data source to lookup on our user list -->
<bean id="daoAuthenticationProvider" class="net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="authenticationDao"><ref bean="accountDAO"/></property>
<property name="userCache"><ref bean="userCache"/></property>
<!-- <property name="authenticationDao"><ref bean="inMemoryDaoImpl"/></property> -->
<!-- <property name="saltSource"><ref bean="saltSource"/></property> -->
<property name="passwordEncoder"><ref bean="passwordEncoder"/></property>
</bean>
<!-- Authentication Caching -->
<bean id="userCache" class="net.sf.acegisecurity.providers.dao.cache.EhCacheBasedUserCache">
<property name="cache"><ref local="userCacheBackend"/></property>
</bean>
<bean id="userCacheBackend" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
<property name="cacheManager"><ref local="cacheManager"/></property>
<property name="cacheName"><value>userCache</value></property>
</bean>
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation"><value>classpath:/ehcache-failsafe.xml</value></property>
</bean>
<!-- Anonymous user/role for public access -->
<bean id="anonymousAuthenticationProvider" class="net.sf.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider">
<property name="key"><value>anonUser</value></property>
</bean>
<bean id="anonymousProcessingFilter" class="net.sf.acegisecurity.providers.anonymous.AnonymousProcessingFilter">
<property name="key"><value>anonUser</value></property>
<property name="userAttribute"><value>anonymousUser,ROLE_ANONYMOUS</value></property>
</bean>
<!-- MD5 Password Encryption -->
<bean id="passwordEncoder" class="net.sf.acegisecurity.providers.encoding.Md5PasswordEncoder"/>
</beans>