rene-d / netatmo

Python3 API for the Netatmo Weather Station
The Unlicense
36 stars 18 forks source link

Spaces in password result in error #13

Closed AnttiKurittu closed 3 years ago

AnttiKurittu commented 3 years ago

Authentication fails when spaces are present in password.

Steps to reproduce:

Change netatmo password to a string with spaces, write password to .netatmorc, test connection.

Result: ➜ ~ netatmo test error invalid_grant https://api.netatmo.com/oauth2/token netatmo.py : ERROR

rene-d commented 3 years ago

« Spaces are not allowed within the password. »

BTW, the ConfigParser object that saves and loads the configuration is fair with spaces in strings.

image

AnttiKurittu commented 3 years ago

Hmm, I registered through the Netatmo app, and it accepted my spacy password. I logged in to create the API credentials, and while trying the netatmo python lib it errored. I wrote the config via command line with -u username -p password\ with\ spaces.

I got an error, changed the password and managed to connect.

su 14. helmik. 2021 klo 18.03 rene-d (notifications@github.com) kirjoitti:

[image: image] https://user-images.githubusercontent.com/10288093/107881864-7a667300-6ee6-11eb-8fff-1c1398c9e24f.png

BTW, the ConfigParser object that saves and loads the password take care of spaces.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rene-d/netatmo/issues/13#issuecomment-778798368, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAOEONNESPWYUMPLLYHDWTS67X6VANCNFSM4XTD2BZQ .

-- // Antti Kurittu, +358 44 300 1087

rene-d commented 3 years ago

Well, it's strange. I have tested, the password with a space is well sent to https://api.netatmo.com/oauth2/token You can verify with netatmo config that the password has its space. And you can verify the POST request payload with netatmo -vv test

If they do not allow spaces in password, it is probably because it causes problems... :)

AnttiKurittu commented 3 years ago

I guess the problem is at Netatmo's end then.

If they have a problem with spaces in passwords they're doing something really stupid on their end. Thank you for a quick response and this useful lib!