public class RetryingOAuth extends OAuth implements okhttp3.Interceptor
| Constructor and Description |
|---|
RetryingOAuth(org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder tokenRequestBuilder) |
RetryingOAuth(okhttp3.OkHttpClient client,
org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder tokenRequestBuilder) |
RetryingOAuth(String tokenUrl,
String clientId,
OAuthFlow flow,
String clientSecret,
Map<String,String> parameters) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyToParams(List<Pair> queryParams,
Map<String,String> headerParams,
Map<String,String> cookieParams,
String payload,
String method)
Apply authentication settings to header and query params.
|
org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder |
getTokenRequestBuilder()
Gets the token request builder
|
okhttp3.Response |
intercept(okhttp3.Interceptor.Chain chain) |
void |
setFlow(OAuthFlow flow)
Set the OAuth flow
|
void |
setTokenRequestBuilder(org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder tokenRequestBuilder)
Sets the token request builder
|
boolean |
updateAccessToken(String requestAccessToken)
Returns true if the access token has been updated
|
getAccessToken, setAccessTokenpublic RetryingOAuth(okhttp3.OkHttpClient client,
org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder tokenRequestBuilder)
client - An OkHttp clienttokenRequestBuilder - A token request builderpublic RetryingOAuth(org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder tokenRequestBuilder)
tokenRequestBuilder - A token request builderpublic RetryingOAuth(String tokenUrl, String clientId, OAuthFlow flow, String clientSecret, Map<String,String> 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.flow - OAuth flow.clientSecret - The OAuth2 client secret for the "clientCredentials" flow.parameters - A map of string.public void setFlow(OAuthFlow flow)
flow - The OAuth flow.public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain)
throws IOException
intercept in interface okhttp3.InterceptorIOExceptionpublic boolean updateAccessToken(String requestAccessToken) throws IOException
requestAccessToken - the request access tokenIOException - If fail to update the access tokenpublic org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder getTokenRequestBuilder()
public void setTokenRequestBuilder(org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder tokenRequestBuilder)
tokenRequestBuilder - Token request builderpublic void applyToParams(List<Pair> queryParams, Map<String,String> headerParams, Map<String,String> cookieParams, String payload, String method) throws ApiException
AuthenticationapplyToParams in interface AuthenticationapplyToParams in class OAuthqueryParams - List of query parametersheaderParams - Map of header parameterscookieParams - Map of cookie parameterspayload - HTTP request bodymethod - HTTP methodApiException - if failed to update the parametersCopyright © 2023. All rights reserved.