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

HttpSessionSecurityContextRepository used for AbstractPreAuthenticatedProcessingFilter #15041

Closed
cristibozga opened this issue May 10, 2024 · 1 comment
Assignees
Labels
status: invalid An issue that we don't feel is valid

Comments

@cristibozga
Copy link

I think we should not use HttpSessionSecurityContextRepository as default repository mainly if the security filter chain can be explicitly configured as stateless

IN the version 5.7 inside AbstractPreAuthenticatedProcessingFilter we had a NullSecurityContextRepository and the comment for the setter of the repository is : 'The default action is not to save the SecurityContext'.
In the version 6.0 the repository is a HttpSessionSecurityContextRepository by default but the comment of the setter of the repository still says 'The default action is not to save the SecurityContext.'
Our configuration for the security chain contains
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
but I see that a SessionFaçade is created to store the security context.

Of course, we can explicitly set the repository, but I wonder if the behavior in the 6.0 version is the desired one and which are the arguments of using the HttpSessionSecurityContextRepository .

Thanks in advance

@cristibozga cristibozga added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels May 10, 2024
@marcusdacoregio marcusdacoregio self-assigned this May 23, 2024
@marcusdacoregio marcusdacoregio added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels May 23, 2024
@marcusdacoregio
Copy link
Contributor

Hi, @cristibozga. That was a result of #11763.

More concretely, the fact that it used to use NullSecurityContextRepository was misleading because previously the SecurityContext would get saved using HttpSessionSecurityContextRepository automatically with the SecurityContextPersistenceFilter.
When gh-11786 was resolved, it meant that any authentication needed to be persisted in the Authentication Filter. This means that to preserve the previous behavior, we needed to update AbstractPreAuthenticatedProcessingFIlter to use HttpSessionSecurityContextRepository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

2 participants