hargata/lubelog

Oauth Cookie Invalid

Tunatron opened this issue · 2 comments

I setup Oauth using Authentik as my provider following the docs - and it works as expected initially.
After some time, I'm assuming after a token expires, Lubelogger won't load using my domain, and eventually shows bad gateway.

Lubelogger's log shows:

CarCareTracker.Middleware.Authen[7]
AuthN was not authenticated. Failure message: Cookie is invalid or does not exist.

If I restart Authentik, the domain is accessible again and I can login using Oauth again - but the problem will repeat itself.

I believe this is a problem with Authentik itself and not LubeLogger.

With the way OIDC works, LubeLogger doesn't "load" your domain, it redirects your browser to your instance of Authentik with a redirect url.

If you're getting a Bad Gateway error when you click the Login via OpenID button, it will appear that you have a misconfiguration on your Authentik instance or a reverse proxy(if you have one).

Just wanted to add a note in case anyone has the same issue - using Authentik's local address (containername:9000) as the Token URL in Lubelogger's variables, instead of auth.domain.com seems to have resolve this issue for me.

Edit - this also wasn't the problem and was just a temporary "fix". Ultimately the issue was caused by having traefik not correctly setup for multiple docker networks. Everything works now.