congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
CommonsHttpOAuthProvider.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
oauth.signpost.commonshttp.CommonsHttpOAuthProvider
constructor

Best Java code snippets using oauth.signpost.commonshttp.CommonsHttpOAuthProvider.<init> (Showing top 20 results out of 315)

origin: stackoverflow.com

 //The consumer object was lost because the browser got into foreground, need to instantiate it again with your apps token and secret.
consumer = new CommonsHttpOAuthConsumer("xxx", "yyy"); 

//Set the requestToken and the tokenSecret that you got earlier by calling retrieveRequestToken.
consumer.setTokenWithSecret(requestToken, tokenSecret);

//The provider object is lost, too, so instantiate it again.
provider = new CommonsHttpOAuthProvider("https://api.twitter.com/oauth/request_token", 
                "https://api.twitter.com/oauth/access_token", 
                "https://api.twitter.com/oauth/authorize");     
//Now that's really important. Because you don't perform the retrieveRequestToken method at this moment, the OAuth method is not detected automatically (there is no communication with Twitter). So, the default is 1.0 which is wrong because the initial request was performed with 1.0a.
provider.setOAuth10a(true);

provider.retrieveAccessToken(consumer, verifier);
origin: mttkay/signpost

  @Override
  protected OAuthProvider buildProvider(String requestTokenUrl, String accessTokenUrl,
      String websiteUrl, boolean mockConnection) throws Exception {
    if (mockConnection) {
      CommonHttpOAuthProviderMock provider = new CommonHttpOAuthProviderMock(requestTokenUrl,
          accessTokenUrl, websiteUrl);
      provider.mockConnection(OAuth.OAUTH_TOKEN + "=" + TOKEN + "&"
          + OAuth.OAUTH_TOKEN_SECRET + "=" + TOKEN_SECRET);
      return provider;
    }
    return new CommonsHttpOAuthProvider(requestTokenUrl, accessTokenUrl, websiteUrl);
  }
}
origin: org.openestate.is24/OpenEstate-IS24-REST-hc42

@Override
protected OAuthProvider buildOAuthProvider( String apiBaseUrl )
{
 if (httpClient==null) setDefaultHttpClient();
 return new CommonsHttpOAuthProvider(
  apiBaseUrl + "/security/oauth/request_token",
  apiBaseUrl + "/security/oauth/access_token",
  apiBaseUrl + "/security/oauth/confirm_access",
  httpClient );
}
origin: org.openestate.is24/OpenEstate-IS24-REST-HC43

@Override
protected OAuthProvider buildOAuthProvider(String apiBaseUrl) {
  if (httpClient == null) setDefaultHttpClient();
  return new CommonsHttpOAuthProvider(
      apiBaseUrl + "/security/oauth/request_token",
      apiBaseUrl + "/security/oauth/access_token",
      apiBaseUrl + "/security/oauth/confirm_access",
      httpClient);
}
origin: com.typesafe.play/play-java-ws

public OAuth(ServiceInfo info, boolean use10a) {
  this.info = info;
  this.provider = new CommonsHttpOAuthProvider(info.requestTokenURL, info.accessTokenURL, info.authorizationURL);
  this.provider.setOAuth10a(use10a);
}
origin: play/play-java

public OAuth(ServiceInfo info, boolean use10a) {
  this.info = info;
  this.provider = new CommonsHttpOAuthProvider(info.requestTokenURL, info.accessTokenURL, info.authorizationURL);
  this.provider.setOAuth10a(use10a);
}
origin: org.openestate.is24/OpenEstate-IS24-REST-hc43

@Override
protected OAuthProvider buildOAuthProvider( String apiBaseUrl )
{
 if (httpClient==null) setDefaultHttpClient();
 return new CommonsHttpOAuthProvider(
  apiBaseUrl + "/security/oauth/request_token",
  apiBaseUrl + "/security/oauth/access_token",
  apiBaseUrl + "/security/oauth/confirm_access",
  httpClient );
}
origin: stackoverflow.com

 mTwitter = new TwitterFactory().getInstance();

mHttpOauthConsumer = new CommonsHttpOAuthConsumer(twitterConsumerKey, twitterSecretKey);
mHttpOauthprovider = new CommonsHttpOAuthProvider("https://twitter.com/oauth/request_token",
    "https://twitter.com/oauth/access_token",
    "https://twitter.com/oauth/authorize");

try{
  authUrl = mHttpOauthprovider.retrieveRequestToken(mHttpOauthConsumer, CALLBACK_URL);
}catch(OAuthCommunicationException oACEx){
  Log.d("", "");
}catch(OAuthMessageSignerException oAMSEx){
  Log.d("", "");
}catch(OAuthNotAuthorizedException oANAEx){
  Log.d("", "");
}catch(OAuthExpectationFailedException oAEFEx){
  Log.d("", "");
}
origin: stackoverflow.com

//Generate a new oAuthConsumer object
     commonsHttpOAuthConsumer
         = new CommonsHttpOAuthConsumer(
         "Consumer Key",
         "Consumer Secret Key");
     //Generate a new oAuthProvider object
     commonsHttpOAuthProvider
         = new CommonsHttpOAuthProvider(
         "https://www.tumblr.com/oauth/request_token",
         "https://www.tumblr.com/oauth/access_token",
         "https://www.tumblr.com/oauth/authorize");
     //Retrieve the URL to which the user must be sent in order to authorize the consumer
     return commonsHttpOAuthProvider.retrieveRequestToken(
         commonsHttpOAuthConsumer,
         "Callback URL as registered with Tumblr"
     );
origin: DirectProject/nhin-d

/**
 * Constructor.
 * 
 * @param consumerKey
 *            the consumer key to manager.
 * @param consumerSecret
 *            the corresponding consumer secret.
 * @param accessTokenUrl
 *            the URL of the OAuth service's access token endpoint.
 * @param httpClient
 *            the {@link HttpClient} to use to communicate with the OAuth service.
 * @throws OAuthException
 *             if an error occurs with one of the OAuth components during initialization.
 */
public OAuthManager(String consumerKey, String consumerSecret, String accessTokenUrl,
    HttpClient httpClient) throws OAuthMessageSignerException, OAuthNotAuthorizedException,
    OAuthExpectationFailedException, OAuthCommunicationException 
{
  
  this(new CommonsHttpOAuthProvider(null, accessTokenUrl, null, httpClient), initConsumer(
      consumerKey, consumerSecret));
}
origin: stackoverflow.com

 private OAuthConsumer consumer;
private OAuthProvider provider;
...
...
...
provider = new CommonsHttpOAuthProvider (
        TWITTER_REQUEST_TOKEN_URL, 
        TWITTER_ACCESS_TOKEN_URL,
        TWITTER_AUTHORIZE_URL);

private void askOAuth() {
    try {
      consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);
      provider = new CommonsHttpOAuthProvider("http://twitter.com/oauth/request_token",
                        "http://twitter.com/oauth/access_token",
                        "http://twitter.com/oauth/authorize");

      provider.setOAuth10a(true);

      String authUrl = provider.retrieveRequestToken(consumer, CALLBACK_URL);
      Toast.makeText(this, "Please authorize this app!", Toast.LENGTH_LONG).show();
      this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));
    } catch (Exception e) {
      Log.e(APP, e.getMessage());
      Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
    }
  }
origin: stackoverflow.com

OAuthProvider provider = new CommonsHttpOAuthProvider(YAHOO_REQUEST_TOKEN_URL , YAHOO_ACCESS_TOKEN_URL, YAHOO_AUTHORIZE_URL);
provider.setOAuth10a(true);
consumer.setTokenWithSecret(yahooToken, yahooTokenSecret);
provider = new CommonsHttpOAuthProvider(YAHOO_REQUEST_TOKEN_URL, YAHOO_ACCESS_TOKEN_URL, YAHOO_AUTHORIZE_URL);
provider.setOAuth10a(true);
origin: stackoverflow.com

commonsHttpOAuthProvider = new CommonsHttpOAuthProvider(TWITTER_OAUTH_REQUEST_TOKEN_ENDPOINT,
    TWITTER_OAUTH_ACCESS_TOKEN_ENDPOINT, TWITTER_OAUTH_AUTHORIZE_ENDPOINT);
commonsHttpOAuthConsumer = new CommonsHttpOAuthConsumer(getString(R.string.twitter_oauth_consumer_key),
origin: stackoverflow.com

mHttpOauthprovider = new CommonsHttpOAuthProvider("https://twitter.com/oauth/request_token",
    "https://twitter.com/oauth/access_token",
    "https://twitter.com/oauth/authorize");
origin: stackoverflow.com

commonsHttpOAuthProvider = new CommonsHttpOAuthProvider(TWITTER_OAUTH_REQUEST_TOKEN_ENDPOINT,
    TWITTER_OAUTH_ACCESS_TOKEN_ENDPOINT, TWITTER_OAUTH_AUTHORIZE_ENDPOINT);
commonsHttpOAuthConsumer = new CommonsHttpOAuthConsumer(getString(R.string.twitter_oauth_consumer_key),
origin: stackoverflow.com

CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);
CommonsHttpOAuthProvider provider =
    new CommonsHttpOAuthProvider(REQUEST_TOKEN_URL, ACCESS_TOKEN_URL, AUTHORIZE_URL);
provider.setOAuth10a(true);
origin: andstatus/andstatus

@Override
public OAuthProvider getProvider() throws ConnectionException {
  CommonsHttpOAuthProvider provider = null;
  provider = new CommonsHttpOAuthProvider(getApiUrl(ApiRoutineEnum.OAUTH_REQUEST_TOKEN),
      getApiUrl(ApiRoutineEnum.OAUTH_ACCESS_TOKEN), getApiUrl(ApiRoutineEnum.OAUTH_AUTHORIZE));
  provider.setHttpClient(ApacheHttpClientUtils.getHttpClient(data.getSslMode()));
  provider.setOAuth10a(true);
  return provider;
}
origin: stackoverflow.com

protected void onCreate(Bundle savedInstanceState) {
  consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET); 
  provider = new CommonsHttpOAuthProvider(REQUEST_TOKEN_URL, ACCESS_TOKEN_URL, AUTHORIZE_WEBSITE_URL);
  if(getIsAuthorized() == 0) {
    callOAuth();
origin: stackoverflow.com

this.mainProvider = new CommonsHttpOAuthProvider(REQUEST_TOKEN_ENDPOINT_URL, ACCESS_TOKEN_ENDPOINT_URL, AUTHORIZE_WEBSITE_URL);
origin: stackoverflow.com

    "mySecret");
mProvider = new CommonsHttpOAuthProvider (
    TWITTER_REQUEST_TOKEN_URL, 
    TWITTER_ACCESS_TOKEN_URL,
oauth.signpost.commonshttpCommonsHttpOAuthProvider<init>

Popular methods of CommonsHttpOAuthProvider

  • setHttpClient
  • retrieveAccessToken
  • retrieveRequestToken
  • setOAuth10a
  • getRequestHeaders
  • getResponseParameters

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getResourceAsStream (ClassLoader)
  • getSharedPreferences (Context)
  • requestLocationUpdates (LocationManager)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Notification (javax.management)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now