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

Bridge seems to not support "secure" tokens #82

Closed
bhuebschen opened this issue Jul 30, 2022 · 3 comments
Closed

Bridge seems to not support "secure" tokens #82

bhuebschen opened this issue Jul 30, 2022 · 3 comments

Comments

@bhuebschen
Copy link

I have a Nuki-Lock and a Nuki-Bridge connected to Home Assistant.

{
   "bridgeType":1,
   "ids":{
      "hardwareId": ####,
      "serverId": ####
   },
   "versions":{
      "firmwareVersion":"2.14.0",
      "wifiFirmwareVersion":"2.3.0"
   },
   "uptime":43432,
   "currentTime":"2022-07-30T06:35:40+00:00",
   "wlanConnected":true,
   "serverConnected":true,
   "scanResults":[
      {
         "deviceType":4,
         "nukiId": ####,
         "name":"Nuki_####",
         "rssi":-50,
         "paired":true
      }
   ]
}

But at some time, pynuki wasnt able to call the api due to an invalid token... after some investigation i found out, that the line:

get_params = hash_token(self.token)

causes the error ... using the plaintext-token as in
get_params = {"token": self.token}

works fine.

Unfortunately i cannot disable "secure"-tokens via Home Assistant.. but on the other hand it would be fine if i know why hased tokens don't work on my setup (and how i can fix that)... now everytime pynuki get's updated, i need to "patch" it to get my setup work again.

Thanks in advance,
Benedikt

@bhuebschen
Copy link
Author

Ich habe aktualisiere normalerweise immer alle firmware's recht zeitnah ... es dürfte also nicht an einer alten Version liegen

@phm46
Copy link

phm46 commented Jul 31, 2022

I have this issue for a long time. In my case it was caused because of wrong date/time on nuki bridge (few hours difference). That's why hash token fails and why I needed to use plaintext token.

@bhuebschen
Copy link
Author

i checked date and time.. everything is fine.. but my bridge still dont want to accept the hashed token

@pschmitt pschmitt closed this as not planned Won't fix, can't repro, duplicate, stale Feb 24, 2024
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