-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[ecobee] Improve handling of access token expiration #7506
Conversation
Signed-off-by: Mark Hilbush <[email protected]>
Travis tests were successfulHey @mhilbush, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Mark Hilbush <[email protected]>
Signed-off-by: Mark Hilbush <[email protected]>
Signed-off-by: Mark Hilbush <[email protected]> Signed-off-by: CSchlipp <[email protected]>
Signed-off-by: Mark Hilbush <[email protected]>
Signed-off-by: Mark Hilbush <[email protected]>
Signed-off-by: Mark Hilbush <[email protected]>
Signed-off-by: Mark Hilbush <[email protected]>
Signed-off-by: Mark Hilbush <[email protected]> Signed-off-by: Daan Meijer <[email protected]>
Signed-off-by: Mark Hilbush <[email protected]>
There have been cases where the call to the Ecobee API has resulted in a response indicating that the token has expired. It happens very rarely, typically once every 2-4 weeks. Generally, this should not happen, since the OAuthClientService in OHC uses an expire time buffer (default is 10 seconds) to refresh the token before it expires.
I wanted to change the expire time buffer to a longer amount, but the API currently doesn't support that. See here.
Therefore, in this PR, the binding will check for expiration using a custom expire time buffer (using
AccessTokenResponse.isExpired()
, then refresh the access token ifisExpired()
returns true.Also, the access token expired response from the Ecobee API will be handled less harshly.
Signed-off-by: Mark Hilbush [email protected]