Skip to content
Advertisement

Not able to prevent multiple concurrent login from the same user in spring security with spring boot

** Here I have edited my code as to see that i’m currently using in memory authentication for this purpose

Here is my Security configuration file, What I want to achieve is for one user to not have concurrent sessions. With this code I can login with same user on multiple tabs. Eventhough the user has an active session Can anyone help me with this.I’m a newbie at Spring security Thanks in Advance**

JavaScript

Advertisement

Answer

Simple check can help you reach similar question here.

Most likely you didn’t implement/override correct hashCode and equals methods in your logined User class.

You have to do something like this, depend how logically you determine the so-called “same” user:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement