Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //this line added to HttpSecurity object
- .and().rememberMe().rememberMeParameter("rememberMe")
- .tokenRepository(persistentTokenRepository())
- .tokenValiditySeconds(86400)
- @Bean
- public DataSource getDataSource() {
- DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
- dataSourceBuilder.driverClassName("${db.driver}");
- dataSourceBuilder.url("${db.url}");
- dataSourceBuilder.username("${db.username}");
- dataSourceBuilder.password("${db.password}");
- return dataSourceBuilder.build();
- }
- @Bean
- public PersistentTokenRepository persistentTokenRepository() {
- JdbcTokenRepositoryImpl jdbcTokenRepository = new JdbcTokenRepositoryImpl();
- jdbcTokenRepository.setDataSource(getDataSource());
- return jdbcTokenRepository;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement