Class OAuth10aService

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class OAuth10aService
    extends OAuthService
    OAuth 1.0a implementation of OAuthService
    • 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()
      • 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,
                                                                                  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_verifier
        callback - optional callback
        Returns:
        Future
      • getVersion

        public java.lang.String getVersion()
        Description copied from class: OAuthService
        Returns the OAuth version of the service.
        Specified by:
        getVersion in class OAuthService
        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)
      • log

        public void log​(java.lang.String messagePattern,
                        java.lang.Object... params)