Closed johntdyer closed 4 years ago
Right now that particular warning occurs in two cases:
Since those endpoints are known, the later case seems the most likely.
Due to the nature of the new API, the proxy maintains "sessions" alive in memory. If the proxy is restarted, any existing sessions disappear and the client needs re-authenticate (e.g. hit the /api/auth endpoint again to get a new token).
Yes, better logging is planned, and session persistence to the disk is also on the TODO list. 😹
Why? The new UnifiOs API is cookie based, and the old API is token based. The cookie is actually just a JWT with an incredibly short lifetime. The proxy handles clients that don't renew the token correctly by automatically mapping new JWT's with the original JWT first given to the client.
Why not just return a 401 to the client? It turns out the new API, given an old token, freaks out (aka takes 60 seconds to respond with a 500). This in turn causes clients like Home Assistant to freakout (aka lockup).
I don't see the api/auth/login
endpoint in the logs. What was the response that you got from the curl command?
Semi-related, I updated the code to handle /api/auth/login
the same as /api/auth
. And IIRC, you need to specify Content-Type
on that endpoint, or else the UnifiOs API gives up.
Closing for now, superseded by #6.
when i try to get an auth token using the following
i get the following error
my compose file is as follows
I am able to ping the health point successfully