Skip to content

Authentication & Identities

The network is built on one identity per person, managed by Kanidm 🡕. This page explains how a service verifies who you are, following two integration paths, and what happens between the browser, the gateway, and Kanidm.

Everything starts from Kanidm, the network’s identity provider (IdP). A service connects to it in two ways, depending on whether it speaks OIDC or not.

PathWhich servicesMechanism
Native OIDCService that speaks OIDC (Forgejo, Immich, Grafana…)The service communicates directly with Kanidm
Authenticating reverse proxyService without auth (homepage, static site, bare UI)oauth2-proxy + Caddy protect the service upstream
Diagram

Accounts and groups are provisioned in Kanidm from etc/config.yaml: one account per person, groups that control access. The users group contains all accounts; idm-admins and idm-devs are the special administration and development groups.

When a service supports OIDC, DNF integrates it automatically: Kanidm provisions one OAuth2 client per service, the secret is managed by sops, and the service redirects itself to Kanidm for login. Nothing to configure manually.

This is the preferred path: the service knows the person’s identity and groups, and can apply its own roles (admin, reader…).

A service without authentication (the homepage, a static site…) cannot verify an identity. DNF then places a Kanidm login screen in front of it, at the gateway’s reverse proxy level. Three components work together:

  • Caddy : the gateway’s reverse proxy. Before serving content, it delegates verification (forward auth) to oauth2-proxy.
  • oauth2-proxy : one daemon per gateway (listens locally), Kanidm’s OAuth2 client. It holds the session and drives the login flow.
  • Kanidm : issues the login screen and identity token.
Diagram

Once the person is logged in, access is filtered by Kanidm group. Caddy passes the list of allowed groups to oauth2-proxy; without membership, the response is 403 even if authenticated.

After login, oauth2-proxy sets a session cookie valid across the entire zone domain (.maison.domain.tld). All protected services in the zone share the same session: you log in once. The flow endpoints (/oauth2/*) are hosted on the home page FQDN of the zone, which serves as the common anchor.

Protection can be limited to external access: internal clients (private LAN and tailnet VPN) reach the service without login, while access from the outside goes through the Kanidm login page. Useful for a portal open at home but protected on the Internet.

  • The oauth2-proxy client secret is shared with Kanidm via sops (a session secret is added as well).
  • The flow introduces no new hostname : it reuses the homepage FQDN, already covered by a TLS certificate of the network.