Grails acegi plugin remember me not working
Im am having problems with the remember me functionality of the grails acegi plugin (version 0.5.3)
The first time I login I check the remember me check box and login. This works. I then shutdown my browser and restart it and browse to the app. The login page is presented with the user name populated, password empty and remember me check box checked. I would have expect to navigate straight into the application (http://localhost:8080/application normally redirects to my landing page). If I try and manually login (enter password) it now doesnt work, I cant get past the login page.
Here is my login form:
<form action='${postUrl}' method='POST' id='loginForm' class='cssform'>
<p>
<label for='j_username'>Email</label>
<input type='text' class='text_' name='j_username' id='j_username' value='${request.remoteUser}' />
</p>
<p>
<label for='j_password'>Password</label>
<input type='password' class='text_' name='j_password' id='j_password' />
</p>
<p>
<label for='remember_me'>Remember me</label>
<input type='checkbox' class='chk' name='_spring_security_remember_me' id='remember_me'
<g:if test='${hasCookie}'>checked='checked'</g:if> />
</p>
<p>
<input type='submit' value='Login' />
</p>
</form>
SecurityConfig.groovy
/** rememberMeServices */
cookieName = 'grails_remember_me'
alwaysRemember = false
tokenValiditySeconds = 1209600 //14 days
parameter = '_spring_security_remember_me'
rememberMeKey = 'grailsRocks'
This is just the default generated behavior. Am I missing something simple? Do I need to manually setup rememberMeServices or something?
I have confirmed that the "grails开发者_StackOverflow社区_remember_me" cookie is being created by using the chrome developer tools. I also get this same behavior with firefox.
Any ideas? Thanks
Never really got to the bottom of this. The way I "fixed" it was by upgrading to the new spring security plugin.
http://grails.org/plugin/spring-security-core
精彩评论