This is my Security config
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/assets/**", "/register/**", "/","/login**")
.permitAll().antMatchers("/profile/**").hasAuthority("ROLE_1").anyRequest().authenticated()
.antMatchers("/actuator/**").hasAuthority("ROLE_2").anyRequest().authenticated()
.and().formLogin().loginPage("/login").permitAll()
.and().sessionManagement().maximumSessions(1).maxSessionsPreventsLogin(true).expiredUrl("/login?expired")
.and().and().logout().deleteCookies("JSESSIONID").invalidateHttpSession(true)
.and().csrf().disable();
// .failureUrl("/fail");
}
This is to add HttpSessionEventPublisher into app context
@Bean
public HttpSessionEventPublisher httpSessionEventPublisher() {
return new HttpSessionEventPublisher();
}
Please let me know what I am missing. I am still able to login from two browsers using same credentials.