public class OAuth20Service extends OAuthService
Constructor and Description |
---|
OAuth20Service(DefaultApi20 api,
OAuthConfig config)
Default constructor
|
close, execute, execute, execute, executeAsync, getConfig
public OAuth20Service(DefaultApi20 api, OAuthConfig config)
api
- OAuth2.0 api informationconfig
- OAuth 2.0 configuration param objectprotected OAuth2AccessToken sendAccessTokenRequestSync(OAuthRequest request) throws IOException, InterruptedException, ExecutionException
protected Future<OAuth2AccessToken> sendAccessTokenRequestAsync(OAuthRequest request)
protected Future<OAuth2AccessToken> sendAccessTokenRequestAsync(OAuthRequest request, OAuthAsyncRequestCallback<OAuth2AccessToken> callback)
public final Future<OAuth2AccessToken> getAccessTokenAsync(String code)
public final Future<OAuth2AccessToken> getAccessTokenAsync(String code, String pkceCodeVerifier)
public final OAuth2AccessToken getAccessToken(String code) throws IOException, InterruptedException, ExecutionException
public final OAuth2AccessToken getAccessToken(String code, String pkceCodeVerifier) throws IOException, InterruptedException, ExecutionException
public final Future<OAuth2AccessToken> getAccessToken(String code, OAuthAsyncRequestCallback<OAuth2AccessToken> callback, String pkceCodeVerifier)
code
- codecallback
- optional callbackpkceCodeVerifier
- pkce Code Verifierpublic final Future<OAuth2AccessToken> getAccessToken(String code, OAuthAsyncRequestCallback<OAuth2AccessToken> callback)
protected OAuthRequest createAccessTokenRequest(String code)
protected OAuthRequest createAccessTokenRequest(String code, String pkceCodeVerifier)
public final Future<OAuth2AccessToken> refreshAccessTokenAsync(String refreshToken)
public final OAuth2AccessToken refreshAccessToken(String refreshToken) throws IOException, InterruptedException, ExecutionException
public final Future<OAuth2AccessToken> refreshAccessToken(String refreshToken, OAuthAsyncRequestCallback<OAuth2AccessToken> callback)
protected OAuthRequest createRefreshTokenRequest(String refreshToken)
public final OAuth2AccessToken getAccessTokenPasswordGrant(String uname, String password) throws IOException, InterruptedException, ExecutionException
public final Future<OAuth2AccessToken> getAccessTokenPasswordGrantAsync(String uname, String password)
public final Future<OAuth2AccessToken> getAccessTokenPasswordGrantAsync(String uname, String password, OAuthAsyncRequestCallback<OAuth2AccessToken> callback)
uname
- User namepassword
- User passwordcallback
- Optional callbackprotected OAuthRequest createAccessTokenPasswordGrantRequest(String username, String password)
public final Future<OAuth2AccessToken> getAccessTokenClientCredentialsGrantAsync()
public final OAuth2AccessToken getAccessTokenClientCredentialsGrant() throws IOException, InterruptedException, ExecutionException
public final Future<OAuth2AccessToken> getAccessTokenClientCredentialsGrant(OAuthAsyncRequestCallback<OAuth2AccessToken> callback)
callback
- optional callbackprotected OAuthRequest createAccessTokenClientCredentialsGrantRequest()
public String getVersion()
getVersion
in class OAuthService
public void signRequest(String accessToken, OAuthRequest request)
public final void signRequest(OAuth2AccessToken accessToken, OAuthRequest request)
public final AuthorizationUrlWithPKCE getAuthorizationUrlWithPKCE()
public final AuthorizationUrlWithPKCE getAuthorizationUrlWithPKCE(Map<String,String> additionalParams)
public final String getAuthorizationUrl()
public final String getAuthorizationUrl(Map<String,String> additionalParams)
additionalParams
- any additional GET params to add to the URLpublic String getAuthorizationUrl(Map<String,String> additionalParams, PKCE pkce)
public DefaultApi20 getApi()
protected OAuthRequest createRevokeTokenRequest(String tokenToRevoke, TokenTypeHint tokenTypeHint)
public final Future<Void> revokeTokenAsync(String tokenToRevoke, TokenTypeHint tokenTypeHint)
public final void revokeToken(String tokenToRevoke) throws IOException, InterruptedException, ExecutionException
public final void revokeToken(String tokenToRevoke, TokenTypeHint tokenTypeHint) throws IOException, InterruptedException, ExecutionException
public final Future<Void> revokeToken(String tokenToRevoke, OAuthAsyncRequestCallback<Void> callback)
public final Future<Void> revokeToken(String tokenToRevoke, OAuthAsyncRequestCallback<Void> callback, TokenTypeHint tokenTypeHint)
public OAuth2Authorization extractAuthorization(String redirectLocation)
Copyright © 2017. All rights reserved.