Package app.sdkgen.client.Authenticator
Class OAuth2Authenticator
- java.lang.Object
-
- app.sdkgen.client.Authenticator.OAuth2Authenticator
-
- All Implemented Interfaces:
AuthenticatorInterface,org.apache.http.HttpRequestInterceptor
public class OAuth2Authenticator extends java.lang.Object implements AuthenticatorInterface
-
-
Constructor Summary
Constructors Constructor Description OAuth2Authenticator(OAuth2 credentials)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringbuildRedirectUrl(java.lang.String redirectUrl, java.util.List<java.lang.String> scopes, java.lang.String state)protected AccessTokenfetchAccessTokenByClientCredentials()protected AccessTokenfetchAccessTokenByCode(java.lang.String code)protected AccessTokenfetchAccessTokenByRefresh(java.lang.String refreshToken)protected java.lang.StringgetAccessToken()protected java.lang.StringgetAccessToken(boolean automaticRefresh, int expireThreshold)voidprocess(org.apache.http.HttpRequest httpRequest, org.apache.http.protocol.HttpContext httpContext)
-
-
-
Constructor Detail
-
OAuth2Authenticator
public OAuth2Authenticator(OAuth2 credentials)
-
-
Method Detail
-
process
public void process(org.apache.http.HttpRequest httpRequest, org.apache.http.protocol.HttpContext httpContext) throws org.apache.http.HttpException, java.io.IOException- Specified by:
processin interfaceorg.apache.http.HttpRequestInterceptor- Throws:
org.apache.http.HttpExceptionjava.io.IOException
-
buildRedirectUrl
public java.lang.String buildRedirectUrl(java.lang.String redirectUrl, java.util.List<java.lang.String> scopes, java.lang.String state) throws java.net.URISyntaxException- Throws:
java.net.URISyntaxException
-
fetchAccessTokenByCode
protected AccessToken fetchAccessTokenByCode(java.lang.String code) throws AccessTokenRequestException, InvalidCredentialsException, InvalidAccessTokenException, TokenPersistException
-
fetchAccessTokenByClientCredentials
protected AccessToken fetchAccessTokenByClientCredentials() throws AccessTokenRequestException, InvalidCredentialsException, InvalidAccessTokenException, TokenPersistException
-
fetchAccessTokenByRefresh
protected AccessToken fetchAccessTokenByRefresh(java.lang.String refreshToken) throws AccessTokenRequestException, FoundNoAccessTokenException, InvalidCredentialsException, InvalidAccessTokenException, TokenPersistException
-
getAccessToken
protected java.lang.String getAccessToken(boolean automaticRefresh, int expireThreshold) throws AccessTokenRequestException, FoundNoAccessTokenException, InvalidAccessTokenException, TokenPersistException, InvalidCredentialsException
-
getAccessToken
protected java.lang.String getAccessToken() throws FoundNoAccessTokenException, AccessTokenRequestException, InvalidAccessTokenException, TokenPersistException, InvalidCredentialsException
-
-