Closed max-tet closed 12 months ago
Grocy can already do this (personally can't help with anything Docker) - references:
https://github.com/grocy/grocy/blob/c9bc10820dddc6534d7a8d29c4f90a2eaef95f2b/config-dist.php#L83-L89
Since v3.0.0:
New feature: External authentication support
- New
config.php
settingAUTH_CLASS
to change the used authentication provider- Via LDAP
- New
config.php
settingsLDAP_DOMAIN
,LDAP_ADDRESS
andLDAP_BASE_DN
- If you set
AUTH_CLASS
toGrocy\Middleware\LdapAuthMiddleware
, users will be authenticated against your directory (and will also be created (in Grocy), if not already present)- Via a reverse proxy
- New
config.php
settingREVERSE_PROXY_AUTH_HEADER
- If you set
AUTH_CLASS
toGrocy\Middleware\ReverseProxyAuthMiddleware
and your reverse proxy sends a username in the HTTP headerREMOTE_USER
(header name can be changed by the settingREVERSE_PROXY_AUTH_HEADER
), the user is automatically authenticated (and will also be created (in Grocy), if not already present)
Since v3.2.0:
- When using reverse proxy authentication (
ReverseProxyAuthMiddleware
), it's now also possible to pass the username in an environment variable instead of an HTTP header (newconfig.php
optionREVERSE_PROXY_AUTH_USE_ENV
)
Thanks for the hint, I did not find that in the docs. I see that you can even disable authentication altogether, which works even better for me!
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.
Here are some examples of apps that feature proxy authentication: FreshRSS, LinkDing, Navidrome.
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.