Class RetryingTokenAuthenticator

java.lang.Object
org.shakespeareframework.retrofit.oauth2.RetryingTokenAuthenticator
All Implemented Interfaces:
okhttp3.Authenticator
Direct Known Subclasses:
ResourceOwnerPasswordTokenAuthenticator

public abstract class RetryingTokenAuthenticator extends Object implements okhttp3.Authenticator
Authenticator that will retry authentication at the #tokenServiceUrl for maxRetries times.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface okhttp3.Authenticator

    okhttp3.Authenticator.Companion
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.shakespeareframework.retrofit.oauth2.Oauth2Api
     

    Fields inherited from interface okhttp3.Authenticator

    Companion, JAVA_NET_AUTHENTICATOR, NONE
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    RetryingTokenAuthenticator(String tokenServiceUrl, int maxRetries)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    okhttp3.Request
    authenticate(okhttp3.Route route, okhttp3.Response response)
     
    protected abstract Oauth2Token
     

    Methods inherited from class java.lang.Object

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

    • oauth2Api

      protected final org.shakespeareframework.retrofit.oauth2.Oauth2Api oauth2Api
  • Constructor Details

    • RetryingTokenAuthenticator

      protected RetryingTokenAuthenticator(String tokenServiceUrl, int maxRetries)
      Parameters:
      tokenServiceUrl - the URl of the token service.
      maxRetries - maximum number of retries.
  • Method Details

    • authenticate

      @Nullable public okhttp3.Request authenticate(@Nullable okhttp3.Route route, @Nonnull okhttp3.Response response)
      Specified by:
      authenticate in interface okhttp3.Authenticator
    • getToken

      protected abstract Oauth2Token getToken()