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

urllib.error.HTTPError: HTTP Error 400: after Netatmo Authentication update #4

Open
zim-olin opened this issue Oct 10, 2023 · 8 comments

Comments

@zim-olin
Copy link

Hi, after the Netatmo authentication update I'm unable to get a successfull connection to Netatmo. I'll get "urllib.error.HTTPError: HTTP Error 400:"

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

@turbosnute
Copy link
Owner

turbosnute commented Oct 27, 2023

Thank you for informing me of the issues with broken oauth. Unfortunately I will not have time to fix it any time soon.

If anyone wants to fix it, I will be happy to receive a pull request.

@mbaiti
Copy link

mbaiti commented Jan 26, 2024

Please add an info to the top of the readme that this container is useless till someone reworked the authentication and maybe link to this Issue.

@turbosnute
Copy link
Owner

Please add an info to the top of the readme that this container is useless till someone reworked the authentication and maybe link to this Issue.

Hi mbaiti. I will do that when I come back to my PC. In the meanwhile I would appreciate it if you start looking at a solution and register a pull request with the fix.

@mbaiti
Copy link

mbaiti commented Jan 26, 2024

Hi @turbosnute,
To be honest, I don't have the experience to rework the authentication problems regarding oauth2.
Some other container already fixed this, maybe this helps: https://github.com/rAcHekLoS/mqtt-netatmo-bridge

@turbosnute
Copy link
Owner

@mbaiti yeah. I'm thinking about writing the whole thing again from the bottom not relying on 3rd party stuff, but I unfortunately have to little time available at the moment

@mbaiti
Copy link

mbaiti commented Jan 26, 2024

@turbosnute sounds great, i would appreciate a rewrite!

@turbosnute
Copy link
Owner

@mbaiti My rewrite is now public. It should work if you configure it correctly. github.com/turbosnute/ps-netatmo-influxdb

@mbaiti
Copy link

mbaiti commented Feb 4, 2024

@turbosnute that's fast! Thank you! In the meantime I found another solution to write the Netatmo data to an InfluxDB.

And to be honest, I liked your previous approach with python and the config via environment variables much more than Powershell and an extra web server with php for the config.

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

No branches or pull requests

3 participants