You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While WebClient works for Spring MVC (Servlet), ReactiveOAuth2ClientAutoConfiguration is only enabled if the application is a reactive web application:
Trying to use authorized clients with WebClient for Spring MVC fails because there is no ReactiveClientRegistrationRepository bean.
Therefore at the moment, it is not possible to use Spring Security OAuth2 Client Authorized Clients with Spring MVC.
Is there any issue enabling ReactiveOAuth2ClientAutoConfiguration even if the application is not a reactive web application? If not, maybe the @Conditional can be removed from ReactiveOAuth2ClientAutoConfiguration.
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion. Things used to work this way but the conditions were changed based on a recommendation from @rwinch. Some changes to this were discussed in #27839 but it didn't really reach a conclusion.
Have you seen this Spring Security sample that @mbhave linked to in #27839? It shows how a WebClient that uses authorized clients can be set up in a Servlet environment.
Spring Security OAuth2 Client only supports authorized clients with
WebClient
, notRestTemplate
(https://docs.spring.io/spring-security/reference/6.1/reactive/oauth2/client/authorized-clients.html).While
WebClient
works for Spring MVC (Servlet),ReactiveOAuth2ClientAutoConfiguration
is only enabled if the application is a reactive web application:spring-boot/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/reactive/ReactiveOAuth2ClientAutoConfiguration.java
Lines 43 to 56 in ae50fa6
Trying to use authorized clients with
WebClient
for Spring MVC fails because there is noReactiveClientRegistrationRepository
bean.Therefore at the moment, it is not possible to use Spring Security OAuth2 Client Authorized Clients with Spring MVC.
Is there any issue enabling
ReactiveOAuth2ClientAutoConfiguration
even if the application is not a reactive web application? If not, maybe the@Conditional
can be removed fromReactiveOAuth2ClientAutoConfiguration
.The text was updated successfully, but these errors were encountered: