4
I need to validate the number of sessions that may exist, so that the user cannot log into two places at the same time with the same credentials. Reading the Spring Security documentation and posts, I arrived at the implementation below, but it does not work.
Has anyone ever had a similar problem, or has some other kind of validation that I could do?
http.sessionManagement()
.maximumSessions(1)
.maxSessionsPreventsLogin(true)
.expiredUrl("/entrar")
.sessionRegistry(sessionRegistry());
There is a project that I had done to test the functionality and the complete class can be seen in the link below as all other project settings that was done just for testing.