Class AuthorizationV2RequestInterceptor

java.lang.Object
net.solarnetwork.web.support.AuthorizationV2RequestInterceptor
All Implemented Interfaces:
org.springframework.http.client.ClientHttpRequestInterceptor

public class AuthorizationV2RequestInterceptor extends Object implements org.springframework.http.client.ClientHttpRequestInterceptor
Interceptor to add an Authorization HTTP header using the SNWS2 scheme.

This class is initialized with an AuthorizationCredentialsProvider instance that must provide the credentials used to authorize and sign each request.

Since:
1.16
Version:
1.3
Author:
matt
  • Constructor Details

    • AuthorizationV2RequestInterceptor

      public AuthorizationV2RequestInterceptor(AuthorizationCredentialsProvider credentialsProvider)
      Constructor.
      Parameters:
      credentialsProvider - the API token credentials provider
  • 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