From 5f9cf39364b504a3db7374daec2fee61c08520c4 Mon Sep 17 00:00:00 2001 From: josuebrunel Date: Sat, 25 Apr 2015 09:49:26 +0200 Subject: [PATCH] #12 : oauth_session_handle added to request header OK --- myql/contrib/auth/auth.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/myql/contrib/auth/auth.py b/myql/contrib/auth/auth.py index c8b8f96..c205f25 100644 --- a/myql/contrib/auth/auth.py +++ b/myql/contrib/auth/auth.py @@ -72,9 +72,8 @@ def isValid(self): def refresh_token(self): """Refresh access token """ - oauth = OAuth1(self.consumer_key, resource_owner_key=self.access_token, callback_uri=CALLBACK_URI) - oauth.client.oauth_session_handle = self.session_handle - response = requests.post(REQUEST_TOKEN_URL, auth=oauth) + oauth = OAuth1(self.consumer_key, resource_owner_key=self.access_token,resource_owner_secret=self.access_token_secret, callback_uri=CALLBACK_URI) + response = requests.post(REQUEST_TOKEN_URL, headers={'oauth_session_handle': self.session_handle}, auth=oauth) tokens = self.fetch_tokens(response.content) return tokens