Commit 5b8d9bfb authored by Josh Roesslein's avatar Josh Roesslein
Browse files

Added support for "sign in with twitter" in OAuthHandler.

parent fef7e054
......@@ -7,7 +7,12 @@ during upgrade will be listed here.
+ Google App Engine fixes (thanks Thomas Bohmbach, Jr)
+ Added Retweet API methods
+ Added Retweet Streaming method
+ Added set_request_token() method to OAuthHandler
+ OAuthHandler
+ Added set_request_token() method
+ Added support for "sign in with twitter".
get_authorization_url() now takes a boolean that when
true uses the "sign in with twitter" flow.
+ Examples
+ Appengine demo (oauth)
......@@ -30,6 +30,7 @@ class OAuthHandler(AuthHandler):
def __init__(self, consumer_key, consumer_secret, callback=None):
......@@ -64,15 +65,19 @@ class OAuthHandler(AuthHandler):
def set_access_token(self, key, secret):
self.access_token = oauth.OAuthToken(key, secret)
def get_authorization_url(self):
def get_authorization_url(self, signin_with_twitter=False):
"""Get the authorization URL to redirect the user"""
# get the request token
self.request_token = self._get_request_token()
# build auth request and return as url
if signin_with_twitter:
auth_url = self.AUTHENTICATE_URL
auth_url = self.AUTHORIZATION_URL
request = oauth.OAuthRequest.from_token_and_callback(
token=self.request_token, http_url=self.AUTHORIZATION_URL
token=self.request_token, http_url=auth_url
return request.to_url()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment