November 2017
Intermediate to advanced
542 pages
14h 24m
English
Finally, we'll need to make some brief configuration changes to the rememberMe declaration to point it to the data source we're using, as shown in the following code snippet:
//src/main/java/com/packtpub/springsecurity/configuration/SecurityConfig.java @Autowired @SuppressWarnings("SpringJavaAutowiringInspection") private DataSource dataSource; @Autowired private PersistentTokenRepository persistentTokenRepository; @Override protected void configure(HttpSecurity http) throws Exception { ... http.rememberMe() .key("jbcpCalendar") .tokenRepository(persistentTokenRepository) ... } @Bean public PersistentTokenRepository persistentTokenRepository() { JdbcTokenRepositoryImpl db = new JdbcTokenRepositoryImpl(); ...Read now
Unlock full access