
Add Homelab SSO with Authentik and Traefik
Technical review: 26 October 2026. Product names, licensing references and procedures reflect this review; check the linked documentation for your release.
Adding single sign-on to several homelab interfaces can reduce separate passwords and make access easier to manage. The boundary matters more than the login page: users should reach the application through the protected reverse proxy, and a direct backend port should not quietly bypass it. Authentik and Traefik can provide that front-door pattern.
Choose the integration that fits the application
Prefer an application’s supported OIDC or SAML integration when it gives the authorization behavior you need. ForwardAuth is useful for placing an authentication gate in front of a web interface that lacks that integration, but it does not automatically turn the application into a multi-user permission system.
Create the Authentik application and proxy provider using the current documentation for the deployed release. Record the external application URL, provider mode and outpost association. Single-application and domain-level modes have different configuration implications; choose deliberately rather than combining examples from both.
Keep the request path clear
Traefik should route the application hostname to the intended backend and call the Authentik outpost for the authentication decision. Callback/outpost routes must reach their correct destination without being trapped behind the same login gate. Do not apply an application’s ForwardAuth middleware to Authentik itself and create a redirect loop.
Configure trusted proxy handling according to the actual network path. Do not trust arbitrary forwarded identity headers from clients or expose the application’s backend port to untrusted networks. A protected hostname does not compensate for an open alternate address that reaches the same interface directly.
Decide which API routes need a different mechanism
Browser SSO is not always appropriate for machine-to-machine endpoints. A monitoring push endpoint or webhook may need its own token-based authentication rather than an interactive redirect. Define such exceptions narrowly and verify the endpoint’s native authentication instead of exempting an entire API tree for convenience.
Keep tokens in protected configuration, and avoid putting them into browser screenshots or shared URLs. An SSO exception must not accidentally expose administrative functions. Test the exact route and HTTP method that the client uses, including the response when its native credential is absent or invalid.
Run four simple acceptance checks
- A signed-out browser is challenged before it can retrieve the protected interface.
- An approved ordinary user can sign in and reach the intended application.
- An unapproved user is denied by the configured policy.
- Direct backend access and malformed callback/API requests do not bypass the intended boundary.
Also test logout and a fresh private browser session; an existing session can conceal a broken redirect or policy decision. Watch for mixed-content or HTTPS-detection problems when the identity service sits behind a proxy.
Back up the provider, outpost and proxy configuration along with the identity database and required secrets, keeping those backups private. Preserve an approved recovery path if the identity provider is unavailable. A convenient login experience is useful, but the operational goal is a clear, testable access boundary across all entry points.
References
- Authentik: proxy provider modes
- Authentik: Traefik ForwardAuth integration
- Authentik: reverse-proxy requirements