Package com.github.scribejava.core.oauth
Class OAuth10aService
java.lang.Object
com.github.scribejava.core.oauth.OAuthService
com.github.scribejava.core.oauth.OAuth10aService
- All Implemented Interfaces:
Closeable,AutoCloseable
OAuth 1.0a implementation of
OAuthService-
Constructor Summary
ConstructorsConstructorDescriptionOAuth10aService(DefaultApi10a api, String apiKey, String apiSecret, String callback, String scope, OutputStream debugStream, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddOAuthParams(OAuthRequest request, String tokenSecret) protected voidappendSignature(OAuthRequest request) getAccessToken(OAuth1RequestToken requestToken, String oauthVerifier) getAccessTokenAsync(OAuth1RequestToken requestToken, String oauthVerifier) getAccessTokenAsync(OAuth1RequestToken requestToken, String oauthVerifier, OAuthAsyncRequestCallback<OAuth1AccessToken> callback) Start the request to retrieve the access token.getApi()getAuthorizationUrl(OAuth1RequestToken requestToken) Returns the URL where you should redirect your users to authenticate your application.Returns the OAuth version of the service.protected OAuthRequestprepareAccessTokenRequest(OAuth1RequestToken requestToken, String oauthVerifier) protected OAuthRequestvoidsignRequest(OAuth1AccessToken token, OAuthRequest request) Methods inherited from class com.github.scribejava.core.oauth.OAuthService
close, execute, execute, execute, executeAsync, getApiKey, getApiSecret, getCallback, isDebug, log, log
-
Constructor Details
-
OAuth10aService
public OAuth10aService(DefaultApi10a api, String apiKey, String apiSecret, String callback, String scope, OutputStream debugStream, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
-
-
Method Details
-
getRequestToken
public OAuth1RequestToken getRequestToken() throws IOException, InterruptedException, ExecutionException -
getRequestTokenAsync
-
getRequestTokenAsync
public Future<OAuth1RequestToken> getRequestTokenAsync(OAuthAsyncRequestCallback<OAuth1RequestToken> callback) -
prepareRequestTokenRequest
-
addOAuthParams
-
getAccessToken
public OAuth1AccessToken getAccessToken(OAuth1RequestToken requestToken, String oauthVerifier) throws IOException, InterruptedException, ExecutionException -
getAccessTokenAsync
public Future<OAuth1AccessToken> getAccessTokenAsync(OAuth1RequestToken requestToken, String oauthVerifier) -
getAccessTokenAsync
public Future<OAuth1AccessToken> getAccessTokenAsync(OAuth1RequestToken requestToken, String oauthVerifier, OAuthAsyncRequestCallback<OAuth1AccessToken> callback) Start the request to retrieve the access token. The optionally provided callback will be called with the Token when it is available.- Parameters:
requestToken- request token (obtained previously or null)oauthVerifier- oauth_verifiercallback- optional callback- Returns:
- Future
-
prepareAccessTokenRequest
protected OAuthRequest prepareAccessTokenRequest(OAuth1RequestToken requestToken, String oauthVerifier) -
signRequest
-
getVersion
Description copied from class:OAuthServiceReturns the OAuth version of the service.- Specified by:
getVersionin classOAuthService- Returns:
- OAuth version as string
-
getAuthorizationUrl
Returns the URL where you should redirect your users to authenticate your application.- Parameters:
requestToken- the request token you need to authorize- Returns:
- the URL where you should redirect your users
-
appendSignature
-
getApi
-