-
Notifications
You must be signed in to change notification settings - Fork 27
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
when expired the refresh do not work #21
Comments
will a re-login / re-authenticate remove the error? |
yes, but the refresh token is for refresh, I wonder it can be refresh like web browser |
You are right of course. I asked because I was wondering if there was any other underlying issue which could be tied to the login/token/authentication. Given that garth is based on oAuth tokens, the expiry dates of the tokens would be such that it's a "long" time. Does it show that these tokens have long expiry time or do they expiry > 1 day? (from your PR #5 (comment)). It technically shouldn't need a refresh so quickly |
yes, but for me and other user, it expiry the other day .... |
@app4g yihong0618/running_page#504 (comment) |
@yihong0618 @app4g To clarify, "refreshing" the OAuth2 token simply obtains a new one: def refresh_oauth2(self):
assert self.oauth1_token
# There is a way to perform a refresh of an OAuth2 token, but it
# appears even Garmin uses this approach when the OAuth2 is expired
self.oauth2_token = sso.exchange(self.oauth1_token, self)
The only way to invalidate an OAuth1 token for Garmin is to change your password and choose to log out of all existing sessions. It appears in the following, the error is occurring during username / password authentication and not during an attempt to refresh the session. Am I understanding that correctly? |
@yihong0618 Could you try getting rid of these lines? if garth.client.oauth2_token.expired:
garth.client.refresh_oauth2() This is handled automatically in Garth. |
will drop it, but seems not these problem. |
The only thing I can think of is the usage of the garmin.com vs garmin.cn domain. Are you also using --is-cn for the GH action? Is the GH action running from a server in the US or China? |
@matin aha, seems my bug, will fix it and test tomorrow. |
I think I should make it to |
@matin seems my fault so closing this and I think we can add |
Sure. We can add it to the OAuth1 token. That's a fairly easy change, and I see the value. |
3 Weeks later and I revisit this and I get what is the difference that is being mentioned in the README and reading the code in your comment above.. Many Thanks. BTW, @matin the oAuth2Token are not really oAuth version 2 right? I see google's cache of Garmin's Health API all states its using oAuth 1.0 tx |
I'm happy to hear it's working for you!
The method in which you obtain the OAuth2 token doesn't follow the spec, but the format of the token itself is consistent with RFC 6749 Section 5.1. |
the issue comes about 1 day.
I printed the error text
its a html
The text was updated successfully, but these errors were encountered: