goauthentik / authentik

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

Add a global URL prefix (multi apps on one sub domain), impossible? #9202

Open LM1LC3N7 opened 3 months ago

LM1LC3N7 commented 3 months ago

Describe your question I have a server, where I want to deploy an application and Authentik using docker. It's been a lot of hours I try to deploy authentik behind a dedicated URL path, but the server always respond without this path prefix.

Traefik is well configured, but Authentik still answer to requests with its base URL without the /sso/. ➡️ Is it possible to explicitely tell to Authentik to use a base URL?

Relevant info Version: last docker image with docker-compose file Traefik: v3.0, PathPrefix is working on whoami image and traefik dashboard

Screenshots Here you can see Authentik responding to the first request on /sso (so traefik config is validated) and redirecting to other URLs without the path prefix.

2024-04-10_10-19

Logs

authentik-server      | {"auth_via": "unauthenticated", "domain_url": "sub.domain.tld", "event": "/", "host": "sub.domain.tld", "level": "info", "logger": "authentik.asgi", "method": "GET", "pid": 55, "remote": "172.29.125.27", "request_id": "87e9c5fde2394665bc002bd3c108de68", "runtime": 56, "schema_name": "public", "scheme": "https", "status": 302, "timestamp": "2024-04-10T08:21:22.582053", "user": "", "user_agent": "Mozilla/5.0 (X11; Linux x86_64; rv:121.0esr) Gecko/20162901 Firefox/121.0esr"}

Version and Deployment (please complete the following information):

LM1LC3N7 commented 3 months ago

When I compare to this issue, the main difference is that now the default docker-compose.yml file does not contains any proxy container: https://github.com/goauthentik/authentik/issues/4509

So it seems it is not my solution.

cfradewavecom commented 2 months ago

Hello, i am getting the same result, its not a traefik problem. I did not find any config/variable to change base url. Can anyone confirm this?

What we would like is to have authentik responding, for example, https://example.com/sso/<authentik api>

Thanks

LM1LC3N7 commented 2 months ago

To me currently it is not possible, so it might be a feature request, not a bug. The initial page load is working well and traefik is doing his job. But then the loaded javascript code is doing some xhr requests or redirections without using the prefix (probably hard coded).

On my side, I was forced to use a dedicated sub domain, even if I didn't wanted this solution.