Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Service provider responded in error: 301 (Moved Permanently) - Twitter API 1.1

I get this error when trying to connect to Twitter? Why?

02-18 16:40:33.270: W/System.err(7167): oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Service provider responded in error: 301 (Moved Permanently)
02-18 16:40:33.270: W/System.err(7167):     at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:218)
02-18 16:40:33.270: W/System.err(7167):     at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:74)
02-18 16:40:33.270: W/System.err(7167):     at app.jp.cropnet.twitter.TwitterApp$2.run(TwitterApp.java:255)
02-18 16:40:33.270: W/System.err(7167): Caused by: oauth.signpost.exception.OAuthCommunicationException: Service provider responded in error: 301 (Moved Permanently)
02-18 16:40:33.270: W/System.err(7167):     at oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:245)
02-18 16:40:33.270: W/System.err(7167):     at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:193)
02-18 16:40:33.270: W/System.err(7167):     ... 2 more
like image 721
emeraldhieu Avatar asked Feb 18 '13 09:02

emeraldhieu


1 Answers

Noticed same issue recently. Had to update twitter oauth paths from http to https like this

new DefaultOAuthProvider(
                        "https://api.twitter.com/oauth/request_token",
                        "https://api.twitter.com/oauth/access_token",
                        "https://api.twitter.com/oauth/authorize");
like image 157
Eugene Popovich Avatar answered Oct 23 '22 05:10

Eugene Popovich