Skip to content

Enable autoconfiguration of OAuth2 machinery in a non-webapp #43978

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

Open
dsyer opened this issue Jan 27, 2025 · 2 comments
Open

Enable autoconfiguration of OAuth2 machinery in a non-webapp #43978

dsyer opened this issue Jan 27, 2025 · 2 comments
Labels
type: enhancement A general enhancement
Milestone

Comments

@dsyer
Copy link
Member

dsyer commented Jan 27, 2025

OAuth2 is useful in messaging and non-servlet, non-webflux apps. A lot of the machinery is not dependent on the web APIs, so it could be exposed as autoconfiguration even when the application context type was not MVC or webflux. E.g. everything in OAuth2ResourceServerAutoConfiguration and the private classes it imports is useful for receiving and authenticating a token, except for the 2 @Bean definitions that create SecurityFilterChain (which is servlet-specific). The same pattern occurs in OAuth2ClientAutoConfiguration but there are fewer beans there - only really one that would be useful outside a webapp (the ClientRegistrationRepository).

Interestingly, I found that as soon as I start adding config properties to spring.security.oauth2.client.registration.* I get a ReactiveClientRegistrationRepository, but not a vanilla blocking ClientRegistrationRepository. It was added for me because Flux was on the classpath, even though I didn't want or need it. That's probably a bug.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 27, 2025
@philwebb
Copy link
Member

See #40997 for a similar ask just on the client side.

@dsyer
Copy link
Member Author

dsyer commented Jan 28, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants