Add support for requesting protected resources with RestClient
similar to ServletBearerExchangeFilterFunction
#15820
Labels
in: oauth2
An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)
type: enhancement
A general enhancement
Milestone
Expected Behavior
It would be nice if the RestClient supported an equivalent of ServletBearerExchangeFilterFunction. This would allow us to easily grab a user's bearer token and pass that on to subsequent client calls without having to explicitly grab the header and token etc.
Current Behavior
Currently I can implement this very easily for a WebClient like this:
As far as I know there is no equivalent implementation for the new RestClient.
Context
This issue is seen as a pretty large blocker for code bases that have to pull a dependency on Spring Boot Starter Webflux (or equivalent) to use WebClient when they are not using a reactive code base. It would be much more preferable to not have to pull that dependency and not have to use reactive code inside a non-reactive code base.
The text was updated successfully, but these errors were encountered: