Package Avalara.SDK.auth
Class RetryingOAuth
- java.lang.Object
-
- Avalara.SDK.auth.OAuth
-
- Avalara.SDK.auth.RetryingOAuth
-
- All Implemented Interfaces:
Authentication,okhttp3.Interceptor
public class RetryingOAuth extends OAuth implements okhttp3.Interceptor
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyToParams(List<Pair> queryParams, Map<String,String> headerParams, Map<String,String> cookieParams, String payload, String method, URI uri)Apply authentication settings to header and query params.StringgetAccessToken(String scope)okhttp3.Responseintercept(okhttp3.Interceptor.Chain chain)voidsetAccessToken(String scope, String accessToken, long expiresInSeconds)booleanupdateAccessToken(String scope, String requestAccessToken)-
Methods inherited from class Avalara.SDK.auth.OAuth
setAccessToken
-
-
-
-
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:
interceptin interfaceokhttp3.Interceptor- Throws:
IOException
-
applyToParams
public void applyToParams(List<Pair> queryParams, Map<String,String> headerParams, Map<String,String> cookieParams, String payload, String method, URI uri) throws ApiException
Description copied from interface:AuthenticationApply authentication settings to header and query params.- Specified by:
applyToParamsin interfaceAuthentication- Overrides:
applyToParamsin classOAuth- Parameters:
queryParams- List of query parametersheaderParams- Map of header parameterscookieParams- Map of cookie parameterspayload- HTTP request bodymethod- HTTP methoduri- URI- Throws:
ApiException- if failed to update the parameters
-
getAccessToken
public String getAccessToken(String scope)
- Overrides:
getAccessTokenin classOAuth
-
-