Skip to content

Instantly share code, notes, and snippets.

@chexov
Created April 3, 2015 06:56
Show Gist options
  • Save chexov/ab18d5d093c1d0f2b608 to your computer and use it in GitHub Desktop.
Save chexov/ab18d5d093c1d0f2b608 to your computer and use it in GitHub Desktop.
How to get EchoAuth for twitter4j. Android
String consumerKey = "";
String consumerSecret = "";
String token = "";
String tokenSecret = "";
Configuration conf = new ConfigurationBuilder().setOAuthConsumerKey(consumerKey).setOAuthConsumerSecret(consumerSecret).setOAuthAccessToken(token).setOAuthAccessTokenSecret(tokenSecret).build();
OAuthAuthorization auth = new OAuthAuthorization(conf);
HttpRequest hr = new HttpRequest(RequestMethod.GET, "https://api.twitter.com/1.1/account/verify_credentials.json", null, auth, null);
String authorizationHeader = auth.getAuthorizationHeader(hr);
System.out.println(authorizationHeader);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment