-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
New authentification method #62
Comments
To improve the security of our products, we inform you that the Client Credentials grant type method will be completely removed. It will no longer be possible to authenticate with the username and password of the user. The effective date of this update is October 2022. How can you authenticate with Netatmo API ? Extract from a mail I received from Netatmo |
Adding documentation from mail: https://dev.netatmo.com/apidocumentation/oauth#authorization-code |
Thanks for opening the issue. I also got the infomail from Netatmo. I will take a look at it soon... |
Since I still had no time to take a look at this refactoring and also no good starting point to integrate a web-redirect-based authentication in the plugin, it looks like it won't be done by Netatmo's deadline this October. So be aware, that this plugin could be stop working and/or breaking your Homebridge setup any time soon. If anyone is interested in participating here feel free to start coding and opening a PR in this repository. |
Hi @skrollme I contacted Netatmo Dev Support to get more details about the new auth method, as I saw that users are now able to create an "access token" via the web portal in addition to the "client_id" and "client_token".
Will this makes it easier to keep the plugin "alive"? Thank you! |
Hi @skrollme
|
Thanks for your investigation, @jostrasser I will take a look at the possibilities we have with your findings this weekend. |
Many thanks @skrollme ! |
Just checked https://dev.netatmo.com/apps/ and to be honest I'm only able to generate access-token in my app's edit-form. No RefreshToken! And in this case it does not really help unless you want to manually generate a new access-token every 3 hours and put it into your homebridge setup :D Or did you find out where you can generate access- AND refresh-token, @jostrasser ? |
Hi skzollme, thanks for your effort. |
The access token can be generated here: https://dev.netatmo.com/apps/ I think this "should" be triggered within 3 hours periodically to stay authorized. |
Netatmo confirmed that the Access token will be permanent but the refresh token has to be refreshed within every 3 hours. Some statements:
I hope this can help you :) |
Hi @juani13973 where did you refreshed the token and what exactly "works again"? This means all 3rd party apps / plugins access are not impacted right now but has to be adopted (Oauth2 authentication) to keep them working. And homebridge-eveatmo is one of it. |
Hello @jostrasser I just logged into Netatmo dev portal and generated a token. Now it works again in Homebridge. Not sure if it's really this which fixed the situation.... but sounds strange |
Ah, I am aware of this issue (run into it a few months ago) FYI: This isn't related to the auth method change which Netatmo is starting in October. |
Thx julien94800. I guess based on the conversation here that I need to do this token refresh every 3 hours with is impossible. once every 3 month would be OK |
Hmm, the "access token" (Oauth2) should not be related to your issues because when you generate a token you have to enter it in your json.conf of Homebridge, otherwise it will not be used... and this is not possible right now ;) But creating a token can force a sync of the authentication change @ Netatmo´s Platform. And this can solve such issues. THIS token will be needed starting October |
Hello @jostrasser Thanks anyway, and let's hope we could find a way to get this plugin still working on future! |
Hi @julien94800 Yes, I think Netatmo is having troubles right now on their side and the described steps are solving it. |
Normally you get access- and refresh-token after auth. You can use the access-token as long as it is valid. If it becomes invalid you need to use the refresh-token to get a new pair of token and everything starts over again. But when I generate a token on https://dev.netatmo.com/apps/ I only get an access-token, no refresh-token. Not sure if Netatmo does something special here or am I missing anything, but to only have the access-token seems useless for long-term usage. |
Hi @skrollme I have an open ticket at Netatmo's Dev Support. I can request some more informations about it. |
But from your statements it looks like we have the current situation now:
If 2) is the case, it could be an easy (temporary) fix to keep the plugin running. I will generate a token now and check if it still works tomorrow. |
@juani13973 and @julien94800 |
Hi @skrollme
|
The access-token did not survive the night, so the "easy solution" won't work. I will start evaluating other ways... |
Feedback from Netatmo Dev Support:
|
I just releases a new beta-version (0.7.0-beta2) of this plugin which uses a refresh_token for authentication.
A first and short test went fine so I'm about to install it on my raspberryPi to use it at home because it definitely needs some long-time testing. Everyone who is able to generate a refresh_token (also not officially supported in the https://dev.netatmo.com/apps/ console) is also invited to do this and test the beta-version. |
Thanks very much @skrollme and all other people who helped for this! Great work, im happy being able using it again in future! |
Today I’ve received email from Netatmo: Authentication updateDear Netatmo developer, Authentication update Dear Netatmo developer, 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 |
I think with 1.1.0 we are well prepared for this change... 😉 |
Hope so! |
I have totally forgotten, that I'm on the beta2 myself 😄 Since I did not have any problems I will prepare the 1.1 release soon and publish it |
Yes, now is the right moment for this I think ;) thank you! :) |
Version 1.1.0 was published a few minutes ago ✅ |
[3/23/2023, 9:44:51 AM] [eveatmo platform] Loaded homebridge-eveatmo v1.1.0 child bridge successfully |
Today nothing happen 12.7.2023, 19:42:50HOOBSeveatmo platformWARNUNGWARN - Netatmo: Error: Authenticate refresh error: invalid_grant What do I select for the "Choose Scopes" on the Netatmo Page ?? |
Hi @The-Paw Create a fresh token pair. I documented the scopes here: |
@jostrasser https://api.netatmo.com/api/getstationdata .. click "get" -> than: { |
And if you try the token generator at https://dev.netatmo.com ? Does this work? I checked my installation right now and all looks fine for me. |
I'm also having these problems by myself lately. But I read somewhere that Netatmo has (even more) API problems in the last weeks so this could be their reason now. At least it did not change anything with my setup and problems started to occur out of nowhere. |
If this issue occurs: is there something to do or will it solve automatically after the API is responding again? |
same here. |
This is correct but the client credential grant type deprecation is well known in the meantime. I think the issue we are facing is not related to this right now because homebridge-eveatmo is already using the new auth method with tokens. A few months ago (18.04.23), Netatmo tries to disable the deprecated grant type and rolled it back after approx. 12 hours because the impact was massive. I contacted the DEV Support and got the confirmation: (Netatmo Support, original text) I didn't get more informations when they will try it again: (Netatmo Support) So there is maybe a service interruption on the Netatmo Cloud infrastructure. The issue looks selective right now and there is no known maintenance window or global outage reported. FYI: |
Ah, one more thing: |
i have created "registered" a new app on dev.netatmo.com. So i got new client_id und client_secrets. |
@DANSI thanks for testing! 👍 |
I'm also having massive problems in the last week with both authentication methods (password and refresh-token). Today I created a new app at dev.netatmo.com (with new client id / secret and so on). It is still working for now 🤞 |
Hi,
My config: Thanks. |
What are we gonna do? According to last Netatmo message May 29, 2024 is deadline. |
Since about two weeks, it doesn't work for me anymore wit node-red-contrib-netatmo-dashboard. |
node-red-contrib-netatmo-dashboard works if you store tokens in the local file system, not in memory.
latest version of homebridge-eveatmo works good |
please read from here https://gist.github.com/matz33/843165d0046cac534864b65e633801a5?permalink_comment_id=4785938#gistcomment-4785938 |
Hello,
Starting October, current way to connect to Netatmo server will be removed and a new one introduced. We will need to find an other way to connect and keep this plugin working
The text was updated successfully, but these errors were encountered: