Description
Spring Security OAuth2 Client only supports authorized clients with WebClient
, not RestTemplate
(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:
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
.