Class OAuth2ClientHttpRequestInterceptor

java.lang.Object
com.mastercard.developer.oauth2.http.spring.restclient.OAuth2ClientHttpRequestInterceptor
All Implemented Interfaces:
org.springframework.http.client.ClientHttpRequestInterceptor

public final class OAuth2ClientHttpRequestInterceptor extends Object implements org.springframework.http.client.ClientHttpRequestInterceptor
An OAuth2 interceptor for Spring RestClient.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new OAuth2 interceptor for Spring RestClient.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.client.ClientHttpResponse
    intercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution)
     

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.http.client.ClientHttpRequestInterceptor

    andThen, apply
  • Constructor Details

    • OAuth2ClientHttpRequestInterceptor

      public OAuth2ClientHttpRequestInterceptor(OAuth2Config config)
      Creates a new OAuth2 interceptor for Spring RestClient.
      Parameters:
      config - A OAuth2 configuration.
  • Method Details

    • intercept

      public org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution) throws IOException
      Specified by:
      intercept in interface org.springframework.http.client.ClientHttpRequestInterceptor
      Throws:
      IOException