-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[server] FR: Proxy authentication by http header value #3
Comments
Yep, I also run authentik for sso. Hkwever, I'd rather try to implement oidc, as it is easier to mix sso an "guest" users like that. With header authentication, every user would have to be registered in the sso provider. |
Yes, I agree, both is useful. Header auth is just a quick win. |
My plan is this now: MONEYBALANCER_AUTH_PROXY_ENABLED=true
MONEYBALANCER_AUTH_PROXY_HEADERS_USERNAME=X-authentik-username
MONEYBALANCER_AUTH_PROXY_HEADERS_NICKNAME=X-authentik-name This would then enable proxy authentication and configure the respective headers. It will also create users in case they do not exist yet. Is that what you wished for @max-tet ? |
Yes, pretty much, thank you! I am just confused about the nickname. By putting it in a header you are setting yourself up for weird corner cases. E.g. how to handle a request containing a valid username but the wrong nickname. Or without nickname? I would decide which name is the unique identifier, probably username. This should be the only one needed in the header. When auto-creating a user, just always fill the nickname with the username and let them change it later in the UI. That removes the |
Authentik provides the display name of the user in the
If the nickname is wrong or missing, even though it is configured, that is the fault of the authentication provider / the user who configured it. If you don't need it, just don't configure it :) |
Ok got it. So you can change details about a user with the headers you are sending in the request. Never seen it like that before, but why not. I am not sure if there are some security implications here though. Well anyway, that feature would be totally fine for my needs. 👍 |
Fixes #3 Will be implemented like this: - The proxy authentication provider has to be configured to protect these routes: - `/api/v1/auth/proxy` - `/#/login/proxy` - Everything else is protected by the regular JWT authentication - The client will redirect to `/#/login/proxy` to trigger the login - The client will get a JWT token by sending an empty POST-request to `/api/v1/auth/proxy`. - This allows an instance to use not only proxy authentication but also another one like local or oidc
@max-tet this should be done :) |
Can't get it to work tbh. I'm not sure if I do something wrong? I start it with these environment variables:
Requests have the header When I access the app, I am redirected to the login view. |
The problem ist probably the casing in the headers. Please make them all lowercase. |
Changed the var to |
Yes it is there. If i click it, there is a screen called "Proxy login ..." with an endless spinner. Edit: There is also this log entry:
|
Whoops, my bad! Just pushed a fix in 05dcea6 |
I can't find any more problems now. Please try again with the newest image :) |
Just tried it, works great! 👍 |
When self-hosting multiple applications, you really want to have a single point for user management and authentication. It is annoying to login to each and every app seperately.
A pretty simple way to centralize authentication is achieved by deploying apps behind a reverse proxy, and use proxy auth. The proxy handles authentication in some way and sets http headers containing the username that was successfully logged-in. The apps read the headers and associate incoming requests to that user.
The perfect proxy auth feature for me would work like this:
Other SSO methods like OIDC still require the user to login with each app, even it no credentials are required. It is still an additional step that is unneeded and hurting the user experience.
Additional context:
I am using the app for this product. Since this is a single-user platform, users really should see no login screen at all, not even for SSO.
The text was updated successfully, but these errors were encountered: