Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twitter's SSL/TLS Requirement Breaks Authorization URL #378

Closed
ericsund opened this issue Jan 15, 2014 · 5 comments
Closed

Twitter's SSL/TLS Requirement Breaks Authorization URL #378

ericsund opened this issue Jan 15, 2014 · 5 comments

Comments

@ericsund
Copy link

As of today (January 14, 2014), Twitter announced that connections to their API will have to go through TLS/SSL connections.

https://dev.twitter.com/discussions/24239

Is may be what is partially or fully responsible for the 403 Forbidden error Tweepy raises when attempting to get the authorization URL. I've ran my program on more than one computer, and this issue is new.

Traceback (most recent call last):
File "Wolf's Den.py", line 42, in
auth_url = auth.get_authorization_url()
File "/usr/lib/python2.7/site-packages/tweepy-2.1-py2.7.egg/tweepy/auth.py", line 96, in get_authorization_url
raise TweepError(e)
tweepy.error.TweepError: HTTP Error 403: Forbidden

If this is not the reason, does anyone have an idea what might be causing a 403? What I do find interesting is my app still functions by manually obtaining the access token/secret from dev.twitter.com. This might mean it's simply a problem with Tweepy, then.

Source: http://www.github.com/Altazon97/WolfsDen/
Tweepy 2.1 (01/14/2014)

@yosida95
Copy link

This problem is occurred because tweepy is using HTTP in default. Your application can authorization by passing one argument to constructor of tweepy.auth.OAuthHandler, secure=True.

auth = tweepy.auth.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET, secure=True)

@ericsund
Copy link
Author

Yes, that does work. That change ported the traffic through a secure connection which makes it comply with the change. Thanks @yosida95!

@tzermias
Copy link

Thanks @yosida95!
Although it works fine for tweepy API calls, when I use Streaming API (StreamListener) this still returns me 401 errors. Any ideas?

@yosida95
Copy link

@tzermias This issue may help you: https://dev.twitter.com/discussions/2941

@tzermias
Copy link

@yosida95 It worked! The issue was that the computer clock was 10 minutes ahead! When I corrected it, the Streaming API worked just fine! Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants