RestClient Support for OAuth2 in Spring Security 6.4
In Spring Security 6.2 and 6.3, we have worked to steadily improve configuration for applications using OAuth2 Client. Configuration for common use cases has been simplified by allowing applications to publish beans which are automatically included in the overall OAuth2 Client configuration during application startup. Recent improvements include:
- Extension grant types can be enabled simply by publishing a bean of type
OAuth2AuthorizedClientProvider
(orReactiveOAuth2AuthorizedClientProvider
) - OAuth 2.0 Access Token Requests can be extended with custom parameters simply by publishing one or more beans of type
OAuth2AccessTokenResponseClient
(orReactiveOAuth2AccessTokenResponseClient
) - Spring Security automatically publishes a bean of type
OAuth2AuthorizedClientManager
(orReactiveOAuth2AuthorizedClientManager
) if one is not already published, requiring less boilerplate configuration when an application needs to obtain access tokens …