Skip to content

Instantly share code, notes, and snippets.

@ento
Created December 26, 2013 02:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ento/8129044 to your computer and use it in GitHub Desktop.
Save ento/8129044 to your computer and use it in GitHub Desktop.
Twitter reverse auth w/ rauth
# -*- 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