-
Notifications
You must be signed in to change notification settings - Fork 6k
Make it possible to use Spring Security with functional bean registration #6624
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
Comments
@sdeleuze Thanks for the report! We definitely want to enable this to progress. Are there reasons that the DSL only makes sense for functional beans and not allowing it to be used in standard Spring Security setups? I'm asking because we have had this sort of request before. |
I have also that goal in mind, the Kotlin DSL that will arise on Spring Fu incubating side could be usable in regular Javaconfig mode as well, like we do on WebFlux router and bean registration side. My plan is to provide a PR for that at some point, when that will be mature enough. |
@sdeleuze I'm not sure it makes sense to expose setter/constructor params in the We definitely want to help move this forward for you, I'm just not seeing how reusing Would you consider using |
Like for Spring Boot features I use in Spring Fu, the idea would be to use package private only setters, use the same Spring Security package on Spring Fu side and later reintegrating the DSL in Spring Security itself. That's why I am only asking for package private access, nothing more. I will use |
I get it now...somehow I misunderstood when I read your comments previously. Let me put something together for you and we can review from there. |
@jgrandja Yes this is exactly that :-) I have just added a question in the PR, see 85abc75#r273683479. |
We would like to start adding Spring Security support in Spring Fu (via an external contributor) but we are currently blocked because unlike Spring Boot configurations, it is not possible to inject programmatically required beans in Spring Security configuration classes.
Our goal is to provide a functional bean registration equivalent of
@EnableWebFluxSecurity
which imports following configurations:ServerHttpSecurityConfiguration
WebFluxSecurityConfiguration
ReactiveOAuth2ClientImportSelector$OAuth2ClientWebFluxSecurityConfiguration
We would like to use these configuration classes like we use Spring Boot configuration classes in https://github.com/spring-projects/spring-fu/tree/master/autoconfigure-adapter, but autowired private field make that impossible.
To solve this, autowired fields should be injectable via protected/package private setters or constructor parameters. That has also the benefit to make these classes easily testable.
Any chance you could make these changes to allow us to move forward on functional configuration for Spring Security?
The text was updated successfully, but these errors were encountered: