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

[Netatmo] oAuth token refresh process evolutions #14546

Closed
clinique opened this issue Mar 7, 2023 · 2 comments · Fixed by #14548
Closed

[Netatmo] oAuth token refresh process evolutions #14546

clinique opened this issue Mar 7, 2023 · 2 comments · Fixed by #14548
Assignees
Labels
enhancement An enhancement or new feature for an existing add-on

Comments

@clinique
Copy link
Contributor

clinique commented Mar 7, 2023

Authentication update

Dear Netatmo developer,

As of today, when you refresh an Access Token using the associated endpoint https://api.netatmo.com/oauth2/token, Netatmo servers respond with a couple of tokens : an Access Token and a Refresh Token.

If the previous Access Token is still valid, the newly returned access token is identical but its expiration time is extended for 3 hours.

In any case, the refresh token is not renewed.

Starting from the 17/04/2023, this behavior will change to to be compliant with the recommendations of the RFC of the OAuth2 Authorization Framework (section 10.4) and improving the security of the data of our users.

When refreshing tokens, Access Token and Refresh Token will be automatically renewed and former tokens invalidated.

What does it means for me ?

If you were already updating the tokens provided when refreshing your tokens, this change will not impact you.

If you do not update the refresh token when refreshing your Access Token, your users will be disconnected after 3 hours as the former tokens will become invalidated.

To fix it, you need to update the tokens as soon as you get the newly generated ones.

Sincerely,

Legrand - Netatmo - Bticino

@clinique clinique added the enhancement An enhancement or new feature for an existing add-on label Mar 7, 2023
@clinique clinique self-assigned this Mar 7, 2023
@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/netatmo-api-changes/145002/4

@clinique
Copy link
Contributor Author

clinique commented Mar 7, 2023

From what I see in the code, once generated for the first time, the refreshToken is stored in configuration and never updated again.
A change in the binding will be implemented to store new value of the refreshToken when provided by the API.
This change will be implemented for current OH4 branch and will have to be backported to OH3.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants