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

EnableMethodSecurity should publish only one bean of each AuthorizationAdvisor #15592

Closed
jzheaux opened this issue Aug 13, 2024 · 0 comments
Closed
Assignees
Labels
in: config An issue in spring-security-config type: bug A general bug
Milestone

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Aug 13, 2024

@EnableMethodSecurity, and more specifically MethodSecurityAdvisorRegistrar registers each Spring Security method interceptor separately as an advisor. Currently, though, it duplicates the bean definition of each one, causing two instances of each AuthorizationAdvisor in the application context.

This causes some unexpected behavior for beans that would like to depend on the list of AuthorizationAdvisor instances, for example in the case of AuthorizationProxyConfiguration.

@jzheaux jzheaux added in: config An issue in spring-security-config type: bug A general bug labels Aug 13, 2024
@jzheaux jzheaux added this to the 6.3.2 milestone Aug 13, 2024
@jzheaux jzheaux self-assigned this Aug 13, 2024
@sjohnr sjohnr modified the milestones: 6.3.2, 6.3.3 Aug 19, 2024
jzheaux added a commit that referenced this issue Aug 19, 2024
Simplifies to use only one ObjectProvider for easier
future maintenance

Issue gh-15592
jzheaux added a commit to jzheaux/spring-security that referenced this issue Sep 16, 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 type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants