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 Future<OAuth2AccessToken> getAccessTokenAsync(String code)
public Future<OAuth2AccessToken> getAccessTokenAsync(String code, String pkceCodeVerifier)
public OAuth2AccessToken getAccessToken(String code) throws IOException, InterruptedException, ExecutionException
public OAuth2AccessToken getAccessToken(String code, String pkceCodeVerifier) throws IOException, InterruptedException, ExecutionException
public Future<OAuth2AccessToken> getAccessToken(String code, OAuthAsyncRequestCallback<OAuth2AccessToken> callback, String pkceCodeVerifier)
code
- codecallback
- optional callbackpkceCodeVerifier
- pkce Code Verifierpublic Future<OAuth2AccessToken> getAccessToken(String code, OAuthAsyncRequestCallback<OAuth2AccessToken> callback)
protected OAuthRequest createAccessTokenRequest(String code)
protected OAuthRequest createAccessTokenRequest(String code, String pkceCodeVerifier)
public Future<OAuth2AccessToken> refreshAccessTokenAsync(String refreshToken)
public OAuth2AccessToken refreshAccessToken(String refreshToken) throws IOException, InterruptedException, ExecutionException
public Future<OAuth2AccessToken> refreshAccessToken(String refreshToken, OAuthAsyncRequestCallback<OAuth2AccessToken> callback)
protected OAuthRequest createRefreshTokenRequest(String refreshToken)
public OAuth2AccessToken getAccessTokenPasswordGrant(String uname, String password) throws IOException, InterruptedException, ExecutionException
public Future<OAuth2AccessToken> getAccessTokenPasswordGrantAsync(String uname, String password)
public Future<OAuth2AccessToken> getAccessTokenPasswordGrantAsync(String uname, String password, OAuthAsyncRequestCallback<OAuth2AccessToken> callback)
uname
- User namepassword
- User passwordcallback
- Optional callbackprotected OAuthRequest createAccessTokenPasswordGrantRequest(String username, String password)
public Future<OAuth2AccessToken> getAccessTokenClientCredentialsGrantAsync()
public OAuth2AccessToken getAccessTokenClientCredentialsGrant() throws IOException, InterruptedException, ExecutionException
public 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 void signRequest(OAuth2AccessToken accessToken, OAuthRequest request)
public AuthorizationUrlWithPKCE getAuthorizationUrlWithPKCE()
public AuthorizationUrlWithPKCE getAuthorizationUrlWithPKCE(Map<String,String> additionalParams)
public String getAuthorizationUrl()
public 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 Future<Void> revokeTokenAsync(String tokenToRevoke, TokenTypeHint tokenTypeHint)
public void revokeToken(String tokenToRevoke) throws IOException, InterruptedException, ExecutionException
public void revokeToken(String tokenToRevoke, TokenTypeHint tokenTypeHint) throws IOException, InterruptedException, ExecutionException
public Future<Void> revokeToken(String tokenToRevoke, OAuthAsyncRequestCallback<Void> callback)
public Future<Void> revokeToken(String tokenToRevoke, OAuthAsyncRequestCallback<Void> callback, TokenTypeHint tokenTypeHint)
public OAuth2Authorization extractAuthorization(String redirectLocation)
Copyright © 2018. All rights reserved.