Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEC-2489: Document equals and hashcode should be overridden on UserDetails when using concurrent session authentication control #2709

Open
spring-projects-issues opened this issue Feb 12, 2014 · 1 comment
Labels
in: docs An issue in Documentation or samples in: web An issue in web modules (web, webmvc) type: jira An issue that was migrated from JIRA type: task A general task

Comments

@spring-projects-issues
Copy link

Quinten Krijger (Migrated from SEC-2489) said:

The implementation of the ConcurrentSessionControlAuthenticationStrategy calls SessionRegistryImpl.getAllSessions, which uses a map from principal to sessions. Therefore, if one implements UserDetails the equals() and hashcode() should be overridden. Otherwise, the strategy will not work.

My proposal here is to document a warning at http://docs.spring.io/spring-security/site/docs/3.2.x/reference/htmlsingle/#ns-concurrent-sessions and http://docs.spring.io/spring-security/site/docs/3.2.x/reference/htmlsingle/#concurrent-sessions that the UserDetails implementation should override equals and hashcode in order for the stategy to function.

@spring-projects-issues spring-projects-issues added in: docs An issue in Documentation or samples in: web An issue in web modules (web, webmvc) Open type: task A general task type: jira An issue that was migrated from JIRA labels Feb 5, 2016
@ledsoft
Copy link

ledsoft commented Dec 11, 2017

👍
Agreed. Just spent several hours trying to figure out why I am able to login twice into my application when maxSessions is set to 1.

@rwinch rwinch removed the Open label May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: docs An issue in Documentation or samples in: web An issue in web modules (web, webmvc) type: jira An issue that was migrated from JIRA type: task A general task
Projects
None yet
Development

No branches or pull requests

3 participants