Class RetryingOAuth

  • All Implemented Interfaces:
    Authentication, okhttp3.Interceptor

    public class RetryingOAuth
    extends OAuth
    implements okhttp3.Interceptor
    • Constructor Detail

      • RetryingOAuth

        public RetryingOAuth​(String tokenUrl,
                             String clientId,
                             String clientSecret,
                             com.nimbusds.oauth2.sdk.AuthorizationGrant authorizationGrant,
                             Map<String,​List<String>> parameters)
        Parameters:
        tokenUrl - The token URL to be used for this OAuth2 flow. Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". The value must be an absolute URL.
        clientId - The OAuth2 client ID for the "clientCredentials" flow.
        clientSecret - The OAuth2 client secret for the "clientCredentials" flow.
    • Method Detail

      • intercept

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

        public void setAccessToken​(String scope,
                                   String accessToken,
                                   long expiresInSeconds)
      • updateAccessToken

        public boolean updateAccessToken​(String scope,
                                         String requestAccessToken)