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 of
OAuthService
-
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
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.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, isDebug, log, log
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
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 Details
-
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
-
getRequestTokenAsync
public java.util.concurrent.Future<OAuth1RequestToken> getRequestTokenAsync(OAuthAsyncRequestCallback<OAuth1RequestToken> callback) -
prepareRequestTokenRequest
-
addOAuthParams
-
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
-
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
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
-