Package sh.ory.hydra.auth
Class RetryingOAuth
- java.lang.Object
-
- sh.ory.hydra.auth.OAuth
-
- sh.ory.hydra.auth.RetryingOAuth
-
- All Implemented Interfaces:
okhttp3.Interceptor,Authentication
public class RetryingOAuth extends OAuth implements okhttp3.Interceptor
-
-
Constructor Summary
Constructors Constructor Description RetryingOAuth(String tokenUrl, String clientId, OAuthFlow flow, String clientSecret, Map<String,String> parameters)RetryingOAuth(okhttp3.OkHttpClient client, org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder tokenRequestBuilder)RetryingOAuth(org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder tokenRequestBuilder)
-
Method Summary
Modifier and Type Method Description voidapplyToParams(List<Pair> queryParams, Map<String,String> headerParams, Map<String,String> cookieParams)Apply authentication settings to header and query params.org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuildergetTokenRequestBuilder()okhttp3.Responseintercept(okhttp3.Interceptor.Chain chain)voidsetFlow(OAuthFlow flow)voidsetTokenRequestBuilder(org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder tokenRequestBuilder)booleanupdateAccessToken(String requestAccessToken)-
Methods inherited from class sh.ory.hydra.auth.OAuth
getAccessToken, setAccessToken
-
-
-
-
Constructor Detail
-
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 Detail
-
setFlow
public void setFlow(OAuthFlow flow)
-
intercept
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException- Specified by:
interceptin interfaceokhttp3.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: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 parameters
-
-