spring-projects / spring-projects/spring-security

SEC-2987: AbstractPreAuthenticatedProcessingFilter should fire a SessionDestroyedEvent when requiresAuthentication invalidates session on principal change

Open
#3,196 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: web type: bug type: jira
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.