goauthentik / authentik

The authentication glue you need.
https://goauthentik.io
Other
7.77k stars 599 forks source link

Oauth Authentication stopped working after host migration #10297

Open Jdplays opened 4 days ago

Jdplays commented 4 days ago

I am trying to migrate my portainer, traefik and authentik instances to another host. I have got them over and running. I copied their data folders over to the new machine and mounted them to their containers, so they are set up exactly the same as before. Traefik seems to work fine and is proxying different things. I can log in to portainer locally and use it. Authentik is also working and i can log in with the same use i did before and i can even use the forward proxy to protect some services with middleware with traefik.

But for some reason any app that uses authentik Oauth doesnt work anymore. I usually log into portainer with Oauth through authentik. Now when i click the button, it does redirect me to authentik which tells me to sign in to view portainer. When i do that everything is successful and it redirects me to portainer. The portainer loads for about a minute and then says it cannot sign in. The docker logs for portainer print this out:

HTTP error | error=Unauthorized msg="A valid authorisation token is missing

I still have the other machine on while i migrate everything else over, so i tore down the authentik containers on the new host and spun them back up on the old host, once dns had been fixed, i tried portainer again. This time it fully logs in. But when i switch it back to the new host, it stops working again

Does anyone know what might be wrong or if there is a propper way to to migrate authentik without having to just copy/paste the mounted data folders. Thanks!

Jdplays commented 4 days ago

So a bit of an update. When i route it through the old instance of traefik, it works file. So it seems like the actual authentik instance is fine. But its just weird that on the new instance, only the Oauth doesnt work. Is there something i am missing?