Skip to content

Add OAuth + RestTemplate support #4920

Closed
@rwinch

Description

@rwinch

Summary

We should provide a simple way to integrate OAuth support with RestTemplate. This support would be similar to the WebClient support, but for RestTemplate.

The WebClient extension for Servlet-based applications is ServletOAuth2AuthorizedClientExchangeFilterFunction.

See the sample oauth2webclient and how to configure and use it.

There are a few tasks involved in order to reach feature parity between ServletOAuth2AuthorizedClientExchangeFilterFunction and RestTemplate support. Here is a break-down of the tasks involved.

  • User should be able to set the current client using either an OAuth2AuthorizedClient or clientRegistrationId
  • Each request should contain the Authorization header with Bearer <access-token> for the current OAuth2AuthorizedClient
  • Get a new access token if it's not available for the current clientRegistrationId
  • Refresh an expired access token - applicable to authorization_code grant clients
  • Get a new access token when current token expired - applicable to client_credentials grant clients
  • Add clock skew support for access token expiry time

Metadata

Metadata

Assignees

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)status: duplicateA duplicate of another issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions