Z-way token Expiration
-
Yes, interesting. I see this too (sometimes.) There is some discrepancy in their docs, at one point it says the default expiry is one week, elsewhere that it is indefinite. I’ll look again when I have moment.
-
If it helps... I am running 3.0.5 which to my understanding made some changes to the token management
-
Well I think I figured it out: When going into the smarthome settings, you have to actually click on the "No Expire" box in order to make that token never expire. Otherwise it expires after one week.
-
Aaaah! OK, that certainly wasn’t clear.
No programmatic way to do this, though?
-
Unfortunately, it doesn't seem to be accessible through any of the APIs that I can see. It should be on the automation API though. Maybe I should look at the command from the browser console. Will try and report back.
-
Seems to be a PUT call to
http://Z-wayUP:8083/ZAutomation/api/v1/profiles/1/token/188e22...
with no request body.
It would return a code 204.
I don't know if my url is truncated or if it needs the full token.Edit:
It seems indeed that the url contains the truncated token with the three dots exactly as it is shown on the smarthome UI. Changing the method from PUT to DELETE, deletes the token.
This is the header:
Request
PUT /ZAutomation/api/v1/profiles/1/token/bcab95... HTTP/1.1
Content-Type: application/json;charset=utf-8
Accept: application/json, text/plain, /
Accept-Encoding: gzip, deflate
Accept-Language: en
Host: 192.168.0.51:8083
Origin: http://192.168.0.51:8083
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15
Connection: keep-alive
Referer: http://192.168.0.51:8083/smarthome/
Content-Length: 2
Cookie: ZWAYSession=bcab95b8-fb88-46c3-aa45-c746671f000c
ZWAYSession: bcab95b8-fb88-46c3-aa45-c746671f000c -
I'm having this issue too. Out of out sudden, no more openLuup -> zway interaction, reload openLuup and got the message about login required again!
-
Have you tried to flag it as permanent with the expert interface?
-
@DesT I am pretty sure that, like me, you didn't flag the token as permanent. I thought I did too as it was showing so on the UI but it's not how it works. See my post above.
I have never seen an expiration since.@rafale77 said in Z-way token Expiration:
Well I think I figured it out: When going into the smarthome settings, you have to actually click on the "No Expire" box in order to make that token never expire. Otherwise it expires after one week.
-
Ahhhhhhhhh even if it's marked as No expire, you need to click on it!
-
Yup, It is not a "mark" It is a button allowing you to set it as "no expire".
-
Need to make sure that it is the token issued to openluup and not to your browser. There should be as many as login sessions you have opened in the past week. Then you need to figure out whether the "no expire" indicator is actually on or off. It isn't the most intuitive.
Given my experience with it, it works perfectly fine so I doubt there is a problem with the z-way. -
i think i was, the token i put "no expire" on had the name "LuaSocket 3.0-rc1"..
Its definately not intuitive, no.. and you may find out that you have to push the button, but you also have to press "save" on what seems to be the table of settings above the connection table.. well, we'll see if it sticks this time!
-
It sticked for over a month, now i'm suddenly thrown out again.. @akbooer: I see in the log that the bridge knows its not logged in (says so in the reply to commands), could you set a variable for this, so reactor can be set up to notify me when this happens?
Seems to be an issue on the z-way side..
-
-
I'm pretty sure it was there, and there was still "not logged in" in the log.. two days since last luup reload (added some sensors)..