yahoo-oauth
yahoo-oauth copied to clipboard
refresh token does not update token in session
Thanks for a great library.
I have a process which is very long running, and I am having trouble with auth token expiring. This is despite my calling the refresh_token method.
I think I may have found the problem.
In the constructor the following is called:
# Getting session if self.oauth_version == 'oauth1': self.session = self.oauth.get_session((self.access_token, self.access_token_secret)) else: self.session = self.oauth.get_session(token=self.access_token)
However, I don't think that session variable is getting updated with the new access token.
Does this make sense?
Thanks, Craig
if I put this below my call to refresh_access_token this works as a work around.
oauth.session = oauth.oauth.get_session(token=oauth.access_token)
I have a periodic task which has worked well past an hour now, maintaining valid credentials.
Doesn't the example in the documentation work ?
The example appears to work, in that it gets a new access token and resets the token_time
variable. However requests continue to be sent with the old access token, which then begin failing 60 seconds later when the old access token expires.
The workaround by @craigham does work.