Announcement Announcement Module
Collapse
No announcement yet.
Remeberme not working in firefox 2 Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Remeberme not working in firefox 2

    For some reason my rememberme config only works in IE. If I login using firefox and then restart the server then I have to login again. With IE it works fine. I changed firefox's cookie config to ask me every time one is set. It seems that acegi is updating the cookie on every request. Perhaps this is intentional? Please help, I'd rather not have to tell users that this feature only works in IE...

    Code:
             <bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy">
    		<property name="filterInvocationDefinitionSource">
    			<value>
    				CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
    				PATTERN_TYPE_APACHE_ANT
    				/**=httpSessionContextIntegrationFilter,logoutFilter,authenticationProcessingFilter,securityContextHolderAwareRequestFilter,rememberMeProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor
    			</value>
    		</property>
    	</bean>
    
    	<bean id="httpSessionContextIntegrationFilter" class="org.acegisecurity.context.HttpSessionContextIntegrationFilter"/>
    
    	<bean id="logoutFilter" class="org.acegisecurity.ui.logout.LogoutFilter">
    		<constructor-arg value="/index.jsp"/> <!-- URL redirected to after logout -->
    		<constructor-arg>
    			<list>
    				<ref bean="rememberMeServices"/>
    				<bean class="org.acegisecurity.ui.logout.SecurityContextLogoutHandler"/>
    			</list>
    		</constructor-arg>
    	</bean>
    
    	<bean id="authenticationProcessingFilter" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter">
    		<property name="authenticationManager" ref="authenticationManager"/>
    		<property name="authenticationFailureUrl" value="${security.authenticationFailure.url}"/>
    		<property name="defaultTargetUrl" value="${security.defaultTarget.url}"/>
    		<property name="filterProcessesUrl" value="/j_acegi_security_check"/>
    		<property name="rememberMeServices" ref="rememberMeServices"/>
    	</bean>
       
    	<bean id="securityContextHolderAwareRequestFilter" class="org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter"/>
    
    	<bean id="rememberMeProcessingFilter" class="org.acegisecurity.ui.rememberme.RememberMeProcessingFilter">
    		<property name="authenticationManager" ref="authenticationManager"/>
    		<property name="rememberMeServices" ref="rememberMeServices"/>
    	</bean>
    
    	<bean id="anonymousProcessingFilter" class="org.acegisecurity.providers.anonymous.AnonymousProcessingFilter">
    		<property name="key" value="${security.anon.key}"/>
    		<property name="userAttribute" value="anonymousUser,ROLE_ANONYMOUS"/>
    	</bean>
    
    	<bean id="exceptionTranslationFilter" class="org.acegisecurity.ui.ExceptionTranslationFilter">
    		<property name="authenticationEntryPoint" ref="authenticationEntryPoint"/>
    		<property name="accessDeniedHandler">
    			<bean class="org.acegisecurity.ui.AccessDeniedHandlerImpl">
    				<property name="errorPage" value="${security.accessDenied.url}"/>
    			</bean>
    		</property>
    	</bean>
    	
    	<bean id="defaultAuthenticationEntryPoint" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint">
    		<property name="loginFormUrl" value="${security.loginForm.url}"/>
    		<property name="forceHttps" value="false"/>
    	</bean>
    	
    	<bean id="authenticationEntryPoint" class="itmg.bsd.security.acegi.ext.AuthenticationEntryPointsManager">
    		<property name="entryPoints">
    			<list>
    				<bean class="itmg.bsd.security.acegi.ext.IpBasedRedirect">
    					<property name="ipAddress" value="128.0.0.1"/>
    					<property name="mask" value="255.255.255.0"/>
    					<property name="url" value="http://www.test.com?returnPath=*"/>
    				</bean>
    				<bean class="itmg.bsd.security.acegi.ext.AuthenticationEntryPointWrapper">
    					<property name="authenticationEntryPoint" ref="defaultAuthenticationEntryPoint" />
    				</bean>
    			</list>
    		</property>
    	</bean>
    
    	<bean id="rememberMeServices" class="org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices">
    		<property name="userDetailsService" ref="userDetailsService"/>
    		<property name="key" value="${security.cookie.key}"/>
    	</bean>
    
    	<bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">
    		<property name="providers">
    			<list>
    				<ref local="daoAuthenticationProvider"/>
    				<bean class="org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider">
    					<property name="key" value="${security.anon.key}"/>
    				</bean>
    				<bean class="org.acegisecurity.providers.rememberme.RememberMeAuthenticationProvider">
    					<property name="key" value="${security.cookie.key}"/>
    				</bean>
    			</list>
    		</property>
    	</bean>
    
    	<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
    		<property name="userDetailsService" ref="userDao"/>
    		<property name="userCache">
    			<bean class="org.acegisecurity.providers.dao.cache.EhCacheBasedUserCache">
    				<property name="cache">
    					<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean">
    						<property name="cacheManager">
    							<bean class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"/>
    						</property>
    						<property name="cacheName" value="userCache"/>
    					</bean>
    				</property>
    			</bean>
    		</property>
    	</bean>
    
    	<!-- UserDetailsService is the most commonly frequently Acegi Security interface implemented by end users -->
    	<bean id="userDetailsService" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
    		<property name="userProperties">
    			<bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
    				<property name="location" value="users.properties"/>
    			</bean>
    		</property>
    	</bean>
    
    	<!-- This bean is optional; it isn't used by any other bean as it only listens and logs -->
    	<bean id="loggerListener" class="org.acegisecurity.event.authentication.LoggerListener"/>
    	
    	<bean id="filterInvocationInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor">
    		<property name="authenticationManager" ref="authenticationManager"/>
    		<property name="accessDecisionManager">
    			<bean class="org.acegisecurity.vote.AffirmativeBased">
    				<property name="allowIfAllAbstainDecisions" value="false"/>
    				<property name="decisionVoters">
    					<list>
    						<bean class="org.acegisecurity.vote.RoleVoter"/>
    						<bean class="org.acegisecurity.vote.AuthenticatedVoter"/>
    					</list>
    				</property>
    			</bean>
    		</property>
    		<property name="objectDefinitionSource" ref="accessRights"/>
    	</bean>

  • #2
    Well it turns out that the problem was that I was referencing different userManagers for rememberMeServices and the daoAuthenticationProvider. The only question that remains is how IE was able to remain logged in across server restarts without using cookies? I'm using tomcat 5.0, could anyone shed some light on this?

    Comment


    • #3
      Originally posted by opsb View Post
      Well it turns out that the problem was that I was referencing different userManagers for rememberMeServices and the daoAuthenticationProvider. The only question that remains is how IE was able to remain logged in across server restarts without using cookies? I'm using tomcat 5.0, could anyone shed some light on this?
      Is tomcat configured for persistent sessions?

      Comment


      • #4
        Yes it was. It's not a feature I was familiar with as I've only just switched to tomcat. Thanks for putting me on to it

        Comment


        • #5
          Originally posted by opsb View Post
          Yes it was. It's not a feature I was familiar with as I've only just switched to tomcat. Thanks for putting me on to it
          Thats ok, I've seen people hunting that one down before. Glad you've solved it .

          Comment

          Working...
          X