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:
java.io.Closeable
,java.lang.AutoCloseable
public class OAuth10aService extends OAuthService
OAuth 1.0a implementation ofOAuthService
-
-
Constructor Summary
Constructors Constructor Description OAuth10aService(DefaultApi10a api, java.lang.String apiKey, java.lang.String apiSecret, java.lang.String callback, java.lang.String scope, java.io.OutputStream debugStream, java.lang.String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addOAuthParams(OAuthRequest request, java.lang.String tokenSecret)
protected void
appendSignature(OAuthRequest request)
OAuth1AccessToken
getAccessToken(OAuth1RequestToken requestToken, java.lang.String oauthVerifier)
java.util.concurrent.Future<OAuth1AccessToken>
getAccessTokenAsync(OAuth1RequestToken requestToken, java.lang.String oauthVerifier)
java.util.concurrent.Future<OAuth1AccessToken>
getAccessTokenAsync(OAuth1RequestToken requestToken, java.lang.String oauthVerifier, OAuthAsyncRequestCallback<OAuth1AccessToken> callback)
Start the request to retrieve the access token.DefaultApi10a
getApi()
java.lang.String
getAuthorizationUrl(OAuth1RequestToken requestToken)
Returns the URL where you should redirect your users to authenticate your application.OAuth1RequestToken
getRequestToken()
java.util.concurrent.Future<OAuth1RequestToken>
getRequestTokenAsync()
java.util.concurrent.Future<OAuth1RequestToken>
getRequestTokenAsync(OAuthAsyncRequestCallback<OAuth1RequestToken> callback)
java.lang.String
getVersion()
Returns the OAuth version of the service.void
log(java.lang.String messagePattern, java.lang.Object... params)
protected OAuthRequest
prepareAccessTokenRequest(OAuth1RequestToken requestToken, java.lang.String oauthVerifier)
protected OAuthRequest
prepareRequestTokenRequest()
void
signRequest(OAuth1AccessToken token, OAuthRequest request)
-
Methods inherited from class com.github.scribejava.core.oauth.OAuthService
close, execute, execute, execute, executeAsync, getApiKey, getApiSecret, getCallback, getScope
-
-
-
-
Constructor Detail
-
OAuth10aService
public OAuth10aService(DefaultApi10a api, java.lang.String apiKey, java.lang.String apiSecret, java.lang.String callback, java.lang.String scope, java.io.OutputStream debugStream, java.lang.String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
-
-
Method Detail
-
getRequestToken
public OAuth1RequestToken getRequestToken() throws java.io.IOException, java.lang.InterruptedException, java.util.concurrent.ExecutionException
- Throws:
java.io.IOException
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
getRequestTokenAsync
public java.util.concurrent.Future<OAuth1RequestToken> getRequestTokenAsync()
-
getRequestTokenAsync
public java.util.concurrent.Future<OAuth1RequestToken> getRequestTokenAsync(OAuthAsyncRequestCallback<OAuth1RequestToken> callback)
-
prepareRequestTokenRequest
protected OAuthRequest prepareRequestTokenRequest()
-
addOAuthParams
protected void addOAuthParams(OAuthRequest request, java.lang.String tokenSecret)
-
getAccessToken
public OAuth1AccessToken getAccessToken(OAuth1RequestToken requestToken, java.lang.String oauthVerifier) throws java.io.IOException, java.lang.InterruptedException, java.util.concurrent.ExecutionException
- Throws:
java.io.IOException
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
getAccessTokenAsync
public java.util.concurrent.Future<OAuth1AccessToken> getAccessTokenAsync(OAuth1RequestToken requestToken, java.lang.String oauthVerifier)
-
getAccessTokenAsync
public java.util.concurrent.Future<OAuth1AccessToken> getAccessTokenAsync(OAuth1RequestToken requestToken, java.lang.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, java.lang.String oauthVerifier)
-
signRequest
public void signRequest(OAuth1AccessToken token, OAuthRequest request)
-
getVersion
public java.lang.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 java.lang.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()
-
log
public void log(java.lang.String messagePattern, java.lang.Object... params)
-
-