Reputation: 89
how to configurate remember me by java configuration. By xml its look like
<http use-expressions="true">
<logout delete-cookies="JSESSIONID" />
<remember-me key="uniqueAndSecret"/>
</http>
in Java class have next configurations , but remember me does not work,but with xml was working..
http.formLogin()
.loginPage("/error?message=you have not permiss.")
.loginProcessingUrl("/j_spring_security_check")
.successHandler(getAuthenticationSuccess())
.failureUrl("/error?message=wrong password or login")
.usernameParameter("j_username")
.passwordParameter("j_password")
.permitAll()
.and()
.authorizeRequests()
.and()
.rememberMe();
http.logout()
.logoutSuccessUrl("/")
.logoutUrl("/logout")
.deleteCookies("JSESSIONID")
.permitAll();
Upvotes: 2
Views: 2104
Reputation: 7195
Use the .key()
method
http.formLogin()
.loginPage("/error?message=you have not permiss.")
...
.and()
.rememberMe()
.key("uniqueAndSecret");
Upvotes: 2