Page 1 of 1

Anabling Remeber me feature on demo

Posted: Mon Dec 03, 2012 7:56 am
by ddelizia
Hi all,
I see that in the applicationcontext-security.xml is present the REMEMBER_ME_FILTER

Code: Select all

<sec:custom-filter ref="blCustomerStateFilter" after="REMEMBER_ME_FILTER"/>

i tried to add to the login.html

Code: Select all

<div class="form50">
<label for="_spring_security_remember_me">Remember me</label>
<input type='checkbox' name='_spring_security_remember_me' class="field50"/>
</div>

But it still does not work.

What I have to do to enable this features on the heat clinic demo?

Thanks

Re: Anabling Remeber me feature on demo

Posted: Fri Dec 07, 2012 12:10 pm
by jefffischer
Try adding these bean to your security app context:

Code: Select all

<bean id="blRememberMeAuthenticationFilter"
      class="org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter">
      <property name="rememberMeServices" ref="blRememberMeServices" />
      <property name="authenticationManager" ref="blAuthenticationManager" />
   </bean>

<bean id="blRememberMeServices"
      class="org.broadleafcommerce.common.security.EnhancedTokenBasedRememberMeServices">
      <property name="key" value="SPRING_SECURITY_REMEMBER_ME_COOKIE" />
      <property name="userDetailsService" ref="blUserDetailsService" />
   </bean>

<bean id="blRememberMeAuthenticationProvider"
      class="org.springframework.security.authentication.RememberMeAuthenticationProvider">
      <property name="key" value="SPRING_SECURITY_REMEMBER_ME_COOKIE" />
   </bean>


You also may need to add blRememberMeAuthenticationFilter as a custom filter to the <http> element.

See http://static.springsource.org/spring-s ... er-me.html for more info on how to use remember-me with spring security.