I am trying to get the authorization url to allow my users to authorize my app for twitter api calls.
I have registered the app at Twitter and gotten the Consumer Key and Secret.
scribe-1.1.3.jar and commons-code-1.5.jar are in the Classpath.
I am running behind a proxy and added System.setProperty("java.net.useSystemProxies", "true");
The code follows:
ServiceBuilder lBuilder = new ServiceBuilder();
lBuilder.provider(TwitterApi.class);
lBuilder.apiKey("----");
lBuilder.apiSecret("----");
OAuthService lService = lBuilder.build();
Token lAccessToken = lService.getRequestToken();
The last line throws exception:
org.scribe.exceptions.OAuthException: Response body is incorrect. Can't extract token and secret from this: 'Failed to validate oauth signature and token'
at org.scribe.extractors.TokenExtractorImpl.extract(TokenExtractorImpl.java:41)
at org.scribe.extractors.TokenExtractorImpl.extract(TokenExtractorImpl.java:27)
at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:45)
It looks like the Twitter response is empty or missing.
Also, I am using a servlet based App and all of your examples are retrieving responses from System.in.
Can I capture the incoming responses through the scribe API?
Thank you.