xenji / homee_exporter

An exporter for homee metrics to prometheus
MIT License
3 stars 1 forks source link

Auth request failure #18

Closed StrikeZW closed 6 years ago

StrikeZW commented 6 years ago

I just get started with this exporter I created a new user specially for this testing purpose but just receive an auth error:

java -jar ./lib/homee_exporter.jar --username xxxx --password xxx --homee-id 000XXXXXX Exception in thread "main" com.github.xenji.homee.api.AuthenticationException: Authentication request failure: 401 at com.github.xenji.homee.api.AuthenticationKt.homeeAccessToken(authentication.kt:59) at com.github.xenji.homee.ExporterKt$main$1.invoke(exporter.kt:38) at com.github.xenji.homee.ExporterKt$main$1.invoke(exporter.kt) at com.xenomachina.argparser.SystemExitExceptionKt.mainBody(SystemExitException.kt:74) at com.xenomachina.argparser.SystemExitExceptionKt.mainBody$default(SystemExitException.kt:72) at com.github.xenji.homee.ExporterKt.main(exporter.kt:35)

bioharz commented 6 years ago

I get also the same error. I think hom.ee have changed there auth method.

xenji commented 6 years ago

Hey, sorry for the late response, the notification drowned in my inbox.

Just to be sure, you have read and followed the info about how to encode your password?

  --password PASSWORD                 your SHA-512 hashed homee password. You
                                      can generate the hashed password by e.g.
                                      using
                                      https://passwordsgenerator.net/sha512-h
                                      ash-generator/

If the question arises why you cannot directly enter your password and the exporter encodes it for you, the answer is simple: I don't want to have code in the public that handles plain text passwords. I just want to get around this potential attack vector.

xenji commented 6 years ago

I can confirm that the authentication method did not change. It is still Basic Auth with your username and the SHA-512 of your password and the token is returned in the same cookie as before.

I've just validated this in the webapp to be sure.

xenji commented 6 years ago

If the method described above does not work for you, please feel free to re-open the issue.