spring-projects / spring-projects/spring-security
SEC-2987: AbstractPreAuthenticatedProcessingFilter should fire a SessionDestroyedEvent when requiresAuthentication invalidates session on principal change
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
Jordi Llach Fernandez (Migrated from SEC-2987) said:
Maybe I am missing something but I think that in method AbstractPreAuthenticatedProcessingFilter.requiresAuthentication when session is invalidated because of a principal change a SessionDestroyedEvent should be fired in order to let others, for instance SessionRegistryImpl, do their work
..
if (invalidateSessionOnPrincipalChange) {
SecurityContextHolder.clearContext();
HttpSession session = request.getSession(false);
if (session != null) {
logger.debug("Invalidating existing session");
// FIRE A SessionDestroyedEvent ?
session.invalidate();
request.getSession();
}
}
...
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 at AbstractPreAuthenticatedProcessingFilter.requiresAuthentication and inspect the session invalidation path shown in the issue. Verify how SessionDestroyedEvent is normally published and how SessionRegistryImpl receives it; done means principal-change invalidation notifies the relevant session listeners.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- authentication, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100