From 4b2e51aee561d7d90c15f2bcadd6893584db22f7 Mon Sep 17 00:00:00 2001 From: Joe Gregorio Date: Wed, 9 Feb 2011 23:27:46 -0500 Subject: [PATCH] Changed OAuth 2.0 to only refresh an access_token upon seeing a 401, ignoring token_expiry for now. --- oauth2client/client.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/oauth2client/client.py b/oauth2client/client.py index 532553a..eeaa453 100644 --- a/oauth2client/client.py +++ b/oauth2client/client.py @@ -202,9 +202,6 @@ class OAuth2Credentials(Credentials): Authorization header.""" if headers == None: headers = {} - if ((self.token_expiry is not None) and (self.token_expiry <= datetime.datetime.now())): - logging.info("Refreshing because %s <= %s" %(self.token_expiry, datetime.datetime.now())) - self._refresh(request_orig) headers['authorization'] = 'OAuth ' + self.access_token if 'user-agent' in headers: headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']