Class OAuth2SecurityInterceptor

java.lang.Object
com.netflix.genie.client.security.oauth2.impl.OAuth2SecurityInterceptor
All Implemented Interfaces:
SecurityInterceptor, okhttp3.Interceptor

public class OAuth2SecurityInterceptor extends Object implements SecurityInterceptor
An interceptor that adds security headers to all outgoing requests.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface okhttp3.Interceptor

    okhttp3.Interceptor.Chain, okhttp3.Interceptor.Companion
  • Field Summary

    Fields inherited from interface okhttp3.Interceptor

    Companion
  • Constructor Summary

    Constructors
    Constructor
    Description
    OAuth2SecurityInterceptor(String url, String clientId, String clientSecret, String grantType, String scope)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    okhttp3.Response
    intercept(okhttp3.Interceptor.Chain chain)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OAuth2SecurityInterceptor

      public OAuth2SecurityInterceptor(String url, String clientId, String clientSecret, String grantType, String scope) throws GenieClientException
      Constructor.
      Parameters:
      url - The URL of the IDP server for getting oauth token.
      clientId - The client id to use to fetch credentials.
      clientSecret - The client secret to use to fetch credentials.
      grantType - The grant type for the user.
      scope - The scope of the user permissions.
      Throws:
      GenieClientException - If there is a problem initializing the object.
  • Method Details

    • intercept

      public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException
      Specified by:
      intercept in interface okhttp3.Interceptor
      Throws:
      IOException