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 voidaddOAuthParams(OAuthRequest request, java.lang.String tokenSecret)protected voidappendSignature(OAuthRequest request)OAuth1AccessTokengetAccessToken(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.DefaultApi10agetApi()java.lang.StringgetAuthorizationUrl(OAuth1RequestToken requestToken)Returns the URL where you should redirect your users to authenticate your application.OAuth1RequestTokengetRequestToken()java.util.concurrent.Future<OAuth1RequestToken>getRequestTokenAsync()java.util.concurrent.Future<OAuth1RequestToken>getRequestTokenAsync(OAuthAsyncRequestCallback<OAuth1RequestToken> callback)java.lang.StringgetVersion()Returns the OAuth version of the service.protected OAuthRequestprepareAccessTokenRequest(OAuth1RequestToken requestToken, java.lang.String oauthVerifier)protected OAuthRequestprepareRequestTokenRequest()voidsignRequest(OAuth1AccessToken token, OAuthRequest request)Methods inherited from class com.github.scribejava.core.oauth.OAuthService
close, execute, execute, execute, executeAsync, getApiKey, getApiSecret, getCallback, isDebug, log, logMethods 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.IOExceptionjava.lang.InterruptedExceptionjava.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.IOExceptionjava.lang.InterruptedExceptionjava.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: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
-