| Filename | Latest commit message | Latest commit date |
|---|---|---|
| assets | ||
| config | ||
| docs | ||
| .gitignore | ||
| README.md | ||
Self-Hosted IAM Lab: One Identity Provider, Three Integration Patterns
A centralized identity platform (Authentik) running on an always-on home NAS, fronting three applications through the three integration patterns you actually meet in enterprise environments — OIDC, forward-auth proxying, and LDAP — behind a Caddy reverse proxy with automated wildcard TLS (ACME DNS-01) and zero services exposed to the WAN.
This isn't a "look, SSO works" demo. The interesting parts are the failure modes: what each pattern can't do, how revoked access actually dies (spoiler: not instantly), and the debugging method that emerged from three protocols producing the same bug in three different costumes.
The three patterns at a glance
| OIDC (Forgejo) | Forward-auth (Syncthing) | LDAP (Jellyfin) | |
|---|---|---|---|
| Where credentials go | IdP's login page — the app never sees the password | IdP's login page — the app never hears the request until it's authenticated | Typed into the app's own form; app relays them to the IdP |
| App awareness | Full: consumes claims, provisions accounts | None: Syncthing doesn't know auth happened | Partial: app drives the bind, maps attributes |
| SSO | Yes | Yes (shares the Authentik session) | No — nothing in the flow consults a cookie |
| Per-user authorization | App-side (claims, groups) | Only the IdP application binding — everyone past the gate is a full admin | App-side via search filter / group DN |
| Revocation on IdP disable | App-local session survives until the app expires it | Outpost's derived proxy session survives until token validity expires | Dies at next bind; existing app tokens survive |
| Right tool when… | App speaks modern auth | App has no usable auth model at all | App predates the modern web but speaks LDAP |
The revocation row is the one worth an interview conversation — see docs/05-lifecycle-demo.md.
Stack
- Host: Debian on an always-on NAS, ZFS datasets per service for snapshot/rollback boundaries
- Edge: Caddy, custom-built with a community ZoneEdit DNS-01 module; single wildcard certificate for
*.graytrack.net - IdP: Authentik (Docker Compose: server, worker, Postgres, plus a compose-managed LDAP outpost)
- Apps: Forgejo (Git hosting, OIDC), Syncthing (forward-auth), Jellyfin (LDAP plugin)
- Network: UDM Pro edge, no inbound port forwards; roaming access via WireGuard only
Repo map
| Path | Contents |
|---|---|
| docs/01-architecture.md | Edge design: DNS-01 wildcard TLS with private A records, loopback-bind policy, firewall end state, security decisions ledger |
| docs/02-pattern-oidc-forgejo.md | OIDC SSO with auto-registration; Authentik as account source of truth |
| docs/03-pattern-forward-auth-syncthing.md | Proxy-layer auth for an identity-blind app; what forward-auth can and cannot convey |
| docs/04-pattern-ldap-jellyfin.md | LDAP outpost, bind-vs-search privileges, the legacy-auth trust burden |
| docs/05-lifecycle-demo.md | Joiner-mover-leaver disable test with measured revocation gaps per pattern |
| docs/06-field-notes.md | Selected debugging stories and the cross-protocol lessons ledger |
| config/ | Sanitized Caddyfile and compose files — secrets stripped, structure intact |
Honest limitations
Stated here rather than discovered by a reader:
- The NAS is a single point of failure. An Authentik outage locks the Syncthing GUI and Jellyfin logins. Each service keeps one documented local break-glass admin for exactly this case.
- The Authentik worker mounts
docker.sock, which is root-equivalent on the host — the IdP can (and once did, unprompted) deploy containers. Kept, with manual outpost deployment as policy; a hardened deployment drops the mount. Details in docs/04. - Revocation is not instant anywhere. Derived sessions outlive core-session deletion by design; the mitigation is short token validity and revoking derived credentials directly, not pretending disable is a kill switch.