Trouble with tokens - reverse proxy
See original GitHub issueI have a bit of a strange issue that I’ve noticed with auth, reverse proxy, and tokens.
I have my HA notification using the following URLs for both preview and image links, just like the documentation.
https://double-take.mydomain.com/api/storage/matches/{{trigger.to_state.attributes.match.filename}}?box=true&token={{trigger.to_state.attributes.token}}
The preview image will show up in the notification, but clicking the link leads to an error page displaying {"error":"Unauthorized"}
Loading the UI, finding the same image, and comparing the links show the last part of the token is different.
For instance, the URL for the image I get from the notification would have something like:
...token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb3V0ZSI6InN0b3JhZ2UiLCJpYXQiOjE2Mjk4MzE0MTgsImV4cCI6MTYyOTgzNTAxOH0.huZHokRVXgSyfYGdYULEDtntf-Hvt1BHgg7JUdZDw64
and the URL for the image I get from the double-take UI would have something like:
...token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb3V0ZSI6InN0b3JhZ2UiLCJpYXQiOjE2Mjk4NDk0ODcsImV4cCI6MTYyOTg1MzA4N30.77ji-R4ILNos6ooQ7EpWqheliN-5hI9MnuNKKLdwPDc
It seems weird that the image will show fine in the notification preview, but not actually load when tapping on the image link.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Thanks, that did the trick!
Hey @D34DC3N73R, I pushed a new beta build with the ability to adjust this. I’m defaulting it to
24h
currently, but can be adjusted by adding this to your config. The value is expressed in seconds or a string describing a time span zeit/ms. Let me know if this resolves your issue.