spring-projects / spring-projects/spring-security
SEC-2489: Document equals and hashcode should be overridden on UserDetails when using concurrent session authentication control
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the concurrent sessions sections at the reference URLs named in the issue: #ns-concurrent-sessions and #concurrent-sessions. Add a warning that UserDetails implementations need equals() and hashCode() for concurrent session control to work, and verify both sections contain the guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- authentication, documentation, security
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100