-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Use SecurityContextHolderStrategy for defaults #11062
Use SecurityContextHolderStrategy for defaults #11062
Conversation
bde3b57
to
3ddbee0
Compare
web/src/main/java/org/springframework/security/web/access/ExceptionTranslationFilter.java
Outdated
Show resolved
Hide resolved
3ddbee0
to
9c68f2f
Compare
740ec1f
to
eba2699
Compare
4515abd
to
547d761
Compare
...pringframework/security/config/annotation/web/configuration/WebMvcSecurityConfiguration.java
Show resolved
Hide resolved
...a/org/springframework/security/config/annotation/web/configurers/AbstractHttpConfigurer.java
Show resolved
Hide resolved
*/ | ||
public SecurityContextConfigurer<H> securityContextHolderStrategy( | ||
SecurityContextHolderStrategy securityContextHolderStrategy) { | ||
getBuilder().setSharedObject(SecurityContextHolderStrategy.class, securityContextHolderStrategy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a concern that the HttpSecurity
and AuthenticationPrincipalArgumentResolver
may have different SecurityContextHoderStrategy
associated with them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll leave the DSL support out for now. It would be rather unexpected to use a different SecurityContextHolderStrategy
for each filter chain. That said, if this turns out to be needed, the argument resolver could possibly be updated to look at the request attribute to get the security context.
03110cd
to
c6bba62
Compare
This introduces support for a
SecurityContextHolderStrategy
bean when used with the minimal configuration:as well as
including the subsequent lookup of the
SecurityContext
using@AuthenticationPrincipal
.