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
public class OAuth10aService extends OAuthService
OAuth 1.0a implementation ofOAuthService
-
-
Constructor Summary
Constructors Constructor Description OAuth10aService(DefaultApi10a api, String apiKey, String apiSecret, String callback, String scope, OutputStream debugStream, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
-
Method Summary
-
Methods inherited from class com.github.scribejava.core.oauth.OAuthService
close, execute, execute, execute, executeAsync, getApiKey, getApiSecret, getCallback, isDebug, log, log
-
-
-
-
Constructor Detail
-
OAuth10aService
public OAuth10aService(DefaultApi10a api, String apiKey, String apiSecret, String callback, String scope, OutputStream debugStream, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
-
-
Method Detail
-
getRequestToken
public OAuth1RequestToken getRequestToken() throws IOException, InterruptedException, ExecutionException
-
getRequestTokenAsync
public Future<OAuth1RequestToken> getRequestTokenAsync()
-
getRequestTokenAsync
public Future<OAuth1RequestToken> getRequestTokenAsync(OAuthAsyncRequestCallback<OAuth1RequestToken> callback)
-
prepareRequestTokenRequest
protected OAuthRequest prepareRequestTokenRequest()
-
addOAuthParams
protected void addOAuthParams(OAuthRequest request, String tokenSecret)
-
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
public void signRequest(OAuth1AccessToken token, OAuthRequest request)
-
getVersion
public String getVersion()
Description copied from class:OAuthService
Returns the OAuth version of the service.- Specified by:
getVersion
in classOAuthService
- Returns:
- OAuth version as string
-
getAuthorizationUrl
public String getAuthorizationUrl(OAuth1RequestToken requestToken)
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
protected void appendSignature(OAuthRequest request)
-
getApi
public DefaultApi10a getApi()
-
-