Class RetryingOAuth

java.lang.Object
org.wso2.am.integration.clients.admin.auth.OAuth
org.wso2.am.integration.clients.admin.auth.RetryingOAuth
All Implemented Interfaces:
okhttp3.Interceptor, Authentication

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

    • RetryingOAuth

      public RetryingOAuth(okhttp3.OkHttpClient client, org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder tokenRequestBuilder)
    • RetryingOAuth

      public RetryingOAuth(org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder tokenRequestBuilder)
    • RetryingOAuth

      public RetryingOAuth(String tokenUrl, String clientId, OAuthFlow flow, String clientSecret, Map<String,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 Details

    • setFlow

      public void setFlow(OAuthFlow flow)
    • intercept

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

      public boolean updateAccessToken(String requestAccessToken) throws IOException
      Throws:
      IOException
    • getTokenRequestBuilder

      public org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder getTokenRequestBuilder()
    • setTokenRequestBuilder

      public void setTokenRequestBuilder(org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder tokenRequestBuilder)
    • applyToParams

      public void applyToParams(List<Pair> queryParams, Map<String,String> headerParams, Map<String,String> cookieParams)
      Description copied from interface: Authentication
      Apply authentication settings to header and query params.
      Specified by:
      applyToParams in interface Authentication
      Overrides:
      applyToParams in class OAuth
      Parameters:
      queryParams - List of query parameters
      headerParams - Map of header parameters
      cookieParams - Map of cookie parameters