Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refresh token does not update token in session #55

Open
craigham opened this issue Mar 21, 2020 · 3 comments
Open

refresh token does not update token in session #55

craigham opened this issue Mar 21, 2020 · 3 comments
Assignees
Labels

Comments

@craigham
Copy link

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

@craigham
Copy link
Author

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.

@josuebrunel josuebrunel self-assigned this May 24, 2020
@josuebrunel
Copy link
Owner

Doesn't the example in the documentation work ?

@jeremywww
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants