When I am using it with Spring boot version 1.5.7, I am getting below error
Description: Field sessionRepository in nl.trifork.App required a bean of type 'org.springframework.session.FindByIndexNameSessionRepository' that could not be found.
Action: Consider defining a bean of type 'org.springframework.session.FindByIndexNameSessionRepository' in your configuration.
using it in APP.java in below manner
@Autowired
private FindByIndexNameSessionRepository<ExpiringSession> sessionRepository;
@Bean
SpringSessionBackedSessionRegistry sessionRegistry() {
return new SpringSessionBackedSessionRegistry<ExpiringSession>(
this.sessionRepository);
}
@Override
protected void configure(HttpSecurity http) throws Exception {
//@formatter:off
http.formLogin().and()
.logout().and()
.csrf().disable()
.sessionManagement()
.maximumSessions(2)
.sessionRegistry(sessionRegistry())
// set to true to prevent logins after reaching max sessions:
.maxSessionsPreventsLogin(false)
.and()
.and()
.authorizeRequests()
.antMatchers("/").authenticated();
//@formatter:on
}
When I am using it with Spring boot version 1.5.7, I am getting below error
using it in APP.java in below manner