Class OAuth2SecurityInterceptor

  • All Implemented Interfaces:
    SecurityInterceptor, okhttp3.Interceptor

    public class OAuth2SecurityInterceptor
    extends java.lang.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​(java.lang.String url, java.lang.String clientId, java.lang.String clientSecret, java.lang.String grantType, java.lang.String scope)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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 Detail

      • OAuth2SecurityInterceptor

        public OAuth2SecurityInterceptor​(java.lang.String url,
                                         java.lang.String clientId,
                                         java.lang.String clientSecret,
                                         java.lang.String grantType,
                                         java.lang.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 Detail

      • intercept

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