Skip to content

LogoutConfigurer#createLogoutFilter sets the SecurityContextHolderStrategy twice #14592

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

Closed
lmorocz opened this issue Feb 13, 2024 · 0 comments
Closed
Assignees
Labels
in: config An issue in spring-security-config status: duplicate A duplicate of another issue type: bug A general bug

Comments

@lmorocz
Copy link

lmorocz commented Feb 13, 2024

The org.springframework.security.config.annotation.web.configurers.LogoutConfigurer#createLogoutFilter method sets the SecurityContextHolderStrategy of the result LogoutFilter twice since #11061 and commit.

I don't see any particular reason behind this because (as of now) the LogoutRequestMatcher and SecurityContextHolderStrategy are unrelated (although org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer#getSecurityContextHolderStrategy is protected so it could be overridden, but LogoutConfigurer is final so there will be no subclasses).

IMHO one result.setSecurityContextHolderStrategy(getSecurityContextHolderStrategy()); call is (and will be) enough here.

My educated guess is that this is some unfortunate side effect of the great copy-paste function. :)

@lmorocz lmorocz added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Feb 13, 2024
kse-music added a commit to kse-music/spring-security that referenced this issue Feb 13, 2024
kse-music added a commit to kse-music/spring-security that referenced this issue Feb 14, 2024
@jzheaux jzheaux self-assigned this Feb 22, 2024
@jzheaux jzheaux added status: duplicate A duplicate of another issue in: config An issue in spring-security-config and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: config An issue in spring-security-config status: duplicate A duplicate of another issue type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants