Created
December 26, 2013 02:35
-
-
Save ento/8129044 to your computer and use it in GitHub Desktop.
Twitter reverse auth w/ rauth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import code | |
from rauth import OAuth1Service | |
from rauth import utils | |
# add x_auth_mode to optional oauth params | |
utils.OPTIONAL_OAUTH_PARAMS = utils.OPTIONAL_OAUTH_PARAMS + ('x_auth_mode',) | |
key = 'consumer key' | |
secret = 'consumer secret' | |
twitter = OAuth1Service( | |
name='twitter', | |
consumer_key=key, | |
consumer_secret=secret, | |
request_token_url='https://api.twitter.com/oauth/request_token', | |
access_token_url='https://api.twitter.com/oauth/access_token', | |
authorize_url='https://api.twitter.com/oauth/authorize', | |
base_url='https://api.twitter.com/1.1/') | |
res = twitter.get_raw_request_token(params=dict(x_auth_mode='reverse_auth')) | |
print res.content | |
code.interact(local=locals()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment