Class OAuth2ClientRequestInterceptor

  • All Implemented Interfaces:
    org.springframework.http.client.ClientHttpRequestInterceptor

    public class OAuth2ClientRequestInterceptor
    extends Object
    implements org.springframework.http.client.ClientHttpRequestInterceptor
    Interceptor that exchanges a token using the OAuth2AccessTokenService and sets Authorization header to this new token, where the aud claim is set to the destination app. The configuration fo this app is retrieved through a configurable matcher implementing ClientConfigurationPropertiesMatcher. If no configuration is found, this interceptor is NOOP. Must be registered by the applications themselves, no automatic bean registration.