]> git.openstreetmap.org Git - osqa.git/commitdiff
Fixed twitter login
authorjavyer <javyer@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 29 May 2013 21:56:57 +0000 (21:56 +0000)
committerjavyer <javyer@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 29 May 2013 21:56:57 +0000 (21:56 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1285 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum_modules/oauthauth/consumer.py

index 1d04aa2d9af26d314aea2b536f0dfc17061b24c2..bbbaac8d53757ec48fa9e20fd648c93ce98764c5 100644 (file)
@@ -40,7 +40,7 @@ class OAuthAbstractAuthConsumer(AuthenticationConsumer):
         if token.key != request.GET.get('oauth_token', 'no-token'):
             raise InvalidAuthentication(_("Something went wrong! Auth tokens do not match"))
 
-        access_token = self.fetch_access_token(token)
+        access_token = self.fetch_access_token(token, request.GET.get('oauth_verifier', '')) 
 
         return access_token.to_string()
 
@@ -74,8 +74,9 @@ class OAuthAbstractAuthConsumer(AuthenticationConsumer):
         full_url='%s?%s'%(self.authorization_url, data)
         return full_url
 
-    def fetch_access_token(self, token):
+    def fetch_access_token(self, token, oauth_verifier): 
         oauth_request = oauth2.Request.from_consumer_and_token(self.consumer, token=token, http_url=self.access_token_url)
+        oauth_request['oauth_verifier'] = oauth_verifier 
         oauth_request.sign_request(self.signature_method, self.consumer, token)
         params = oauth_request
         data = urllib.urlencode(params)