Allow public access without forcing auth, but still pass HTTP headers for SSO capability #935
Replies: 1 comment 5 replies
-
|
Hi @The-Shortman! I'm Dosu and I'm helping the Tinyauth team. Unfortunately, Tinyauth does not currently have an "optional authentication" or "permissive pass-through" mode that would let unauthenticated users access an app while still forwarding SSO headers for authenticated users. This exact use case has been raised before [1], and the maintainer noted it doesn't align well with Tinyauth's current architecture — Tinyauth either requires authentication (returning 401/redirect for unauthenticated users) or fully bypasses it (passing no headers at all). The closest available options are:
None of these achieve the "pass headers if logged in, but don't block if not" behavior you're looking for. This would likely require a new mode in Tinyauth's forward auth endpoint that returns 200 (with empty identity headers) for unauthenticated requests instead of 401, while still populating headers when a valid session cookie exists. You're not missing something obvious — this is a genuine gap in the current feature set. You may want to add a 👍 to the existing discussion or open a feature request to signal interest to the maintainers. To reply, just mention @dosu. Docs are dead. Just use Dosu. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have been scratching my head at this (probably niche) use case for a few days now, and I can't find any explicitly helpful information online.
I have a few self-hosted apps that support SSO via HTTP headers from a trusted reverse-proxy, but don't support any other form of external authentication, such as OIDC. I'm running Tinyauth in a docker compose stack as a Traefik middleware, with LLDAP as the account handler.
My problem is that I don't necessarily wish to block any access to these applications with Tinyauth by using it as a forwardauth middleware, as these applications can be used for certain things that I still wish to be publicly viewable without an account. I only want to be able to pass user info via HTTP headers so that the application knows if the user is logged in via SSO.
As of now, these applications, when placed behind forwardauth middleware, cannot be accessed. I can get around this in some niche scenarios by adding middleware override rules in Traefik's dynamic config, where certain paths in the application are exempt from authorisation, but this causes the app to think the user is logged out when accessing those paths, as it is no longer receiving the headers from Tinyauth.
As an example, one of these applications is a wiki that supports auth using trusted HTTP headers, the pages of which I would prefer to be publicly viewable without an account, but I would also like it to be able to recieve HTTP headers forwarded from either Tinyauth or LLDAP, so that I can log in and edit the pages using my selfhosted SSO ecosystem. Here, to my knowledge, it isn't possible to add exempt paths in Traefik's dynamic config, as the same paths need to be accessed by both a logged-in user, and a logged-out user.
Apologies if I'm missing something glaringly obvious :P
Beta Was this translation helpful? Give feedback.
All reactions