Pages

April 27, 2014

[Solution] Twitter oauth.signpost.exception.OAuthCommunicationException: Service provider responded in error: 403 (Forbidden)

I was searching solution for the error,
"oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Service provider responded in error: 403 (Forbidden)" in android social sharing app that require twitter login. Finally found the problem with oauth urls.

Here's how to solve it.

Change,
public static final String REQUEST_URL = "http://api.twitter.com/oauth/request_token";
public static final String ACCESS_URL = "http://api.twitter.com/oauth/access_token";
public static final String AUTHORIZE_URL = "http://api.twitter.com/oauth/authorize
 To
public static final String REQUEST_URL = "https://api.twitter.com/oauth/request_token";
public static final String ACCESS_URL = "https://api.twitter.com/oauth/access_token";
public static final String AUTHORIZE_URL = "https://api.twitter.com/oauth/authorize";
Summary : change http to https and error got fixed.
Hope this helps!