(Last Updated: June 8, 2020)

Z-way token Expiration



  • @akbooer, I just woke up to a z-way bridge token expiration again forcing me to login again and reload openluup. It appears to happen once a week. It doesn't appear that the auto renewal of the token is working?



  • 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?



  • @akbooer yeah since day 1 😉



  • @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".


Log in to reply