don't dream your life, live your dreams !
Please read Java Spring Security – Database User
Update ‘configure(HttpSecurity http)’ method, add this :
http . (...) .and() .rememberMe() .tokenRepository(persistentTokenRepository()) .tokenValiditySeconds(1209600) .key("remember me") .rememberMeParameter("j_spring_security_remember_me") |
where persistentTokenRepository() :
@Bean public PersistentTokenRepository persistentTokenRepository() { JdbcTokenRepositoryImpl db = new JdbcTokenRepositoryImpl(); db.setDataSource(dataSource); return db; } |
Copyright © 2024 My linux world - by Marc RABAHI
Design by Marc RABAHI and encelades.
admin