Using xAuth from python using tweepy
I am trying to write a twitter client application in python. I would like to use xAuth for authentication. My choice in the library is tweepy because it seems like it knows everything I need.
Here's my problem:
>>> import tweepy
>>> auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
>>> auth.get_xauth_access_token('username', 'password')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "tweepy/auth.py", line 152, in get_xauth_access_token
raise TweepError(e)
tweepy.error.TweepError: HTTP Error 401: Unauthorized
The username and password are correct, I can login with them. CONSUMER_ {KEY, SECRET} is also valid, I copied them from my app page.
Do you have any idea why the code above doesn't work?
a source to share
Have you emailed Twitter support to get them to enable xAuth for your app?
Twitter only wants xAuth to be used by desktop and mobile apps, so registered apps have xAuth disabled by default, and you need someone on Twitter to enable it for you. If the app doesn't have xAuth, you get a 401.
To enable xAuth, send an email to api@twitter.com with the name of your app and the reason it needs xAuth instead of the usual old OAuth (for example, not suitable for pop-up web browser in my desktop app).
a source to share