List of usage examples for twitter4j.auth OAuthAuthorization generateOAuthSignatureHttpParams
public List<HttpParameter> generateOAuthSignatureHttpParams(String method, String url)
From source file:com.dwdesign.tweetings.service.TweetingsService.java
License:Open Source License
public String generateOAuthEchoHeader(final long account_id) { final Twitter twitter = getTwitterInstance(TweetingsService.this, account_id, false); if (twitter != null) { Authorization authorization = twitter.getAuthorization(); if (!(authorization instanceof OAuthAuthorization)) { throw new IllegalArgumentException("OAuth authorization is required."); }/* ww w . j a va 2s.c o m*/ OAuthAuthorization oauth = (OAuthAuthorization) authorization; List<HttpParameter> oauthSignatureParams = oauth.generateOAuthSignatureHttpParams("GET", TWITTER_VERIFY_CREDENTIALS_JSON); return "OAuth realm=\"http://api.twitter.com/\"," + OAuthAuthorization.encodeParameters(oauthSignatureParams, ",", true); } return null; }