Package oauth.signpost.commonshttp

Examples of oauth.signpost.commonshttp.CommonsHttpOAuthConsumer


        if (null == consumerKey || null == consumerSecret) {
            throw new TwitterClientException("missing OAuth credentials");
        }

        consumer = new CommonsHttpOAuthConsumer(
                consumerKey,
                consumerSecret);
        provider = new DefaultOAuthProvider(
                TwitterAPI.OAUTH_REQUEST_TOKEN_URL,
                TwitterAPI.OAUTH_ACCESS_TOKEN_URL,
View Full Code Here


    this.consumerKey = consumerKey;
    this.consumerSecret = consumerSecret;
  }

  public OAuthConsumer createConsumer() {
    CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(consumerKey, consumerSecret) {
      private static final long serialVersionUID = 2077439267247908434L;

      @Override
      protected String generateNonce() {
        // thread-safe nonce generation
        // http://code.google.com/p/oauth-signpost/issues/detail?id=41
        return Long.toString(RANDOM.nextLong());
      }
    };
    consumer.setTokenWithSecret(token, tokenSecret);
    return consumer;
  }
View Full Code Here

TOP

Related Classes of oauth.signpost.commonshttp.CommonsHttpOAuthConsumer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.