Files
coreapp-dev/templates/sso/README.md.append
T
davidandClaude Opus 5.5 d8c6d1011f coreapp new --postgres --sso: database and sign-in together
Overlays no longer replace service: each names the Core apps it needs in
.depends, merged into DEPENDS. The sign-in code is a module (oidc.py)
that examples import; templates/postgres-sso is the combined example
(sign-in, each person's visits counted in PostgreSQL). Tested with
team-visits, including sign-in in a browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 12:43:22 -07:00

22 lines
1.1 KiB
Plaintext

## Sign-in
People sign in with their Core account, through the Core's Authelia
(OpenID Connect, authorization code flow with PKCE):
- `install` registers the client `coreapp-{{NAME}}` in Authelia's
`idproviders.yml` (between `### coreapp-{{NAME}} begin/end` markers), with
the random `OIDC_CLIENT_SECRET` from `.env`, hashed. It checks Authelia's
configuration before restarting it and puts the old one back if the check
fails. `uninstall` removes the client.
- Its redirect URI is `https://{{NAME}}.<domain>/auth/callback`. Change it in
`install` if your app uses another path.
- Authelia decides whether a second factor is needed (the Core's 2FA policy
is applied to every client after each install).
- The app reaches `https://authelia.<domain>` through traefik
(`extra_hosts` in `docker-compose.yml.in`).
- `oidc.py` does the whole flow with Python's standard library, and `app.py`
uses it for `/login`, `/auth/callback` and `/logout`. For a real app, use
your framework's OpenID Connect library with `OIDC_ISSUER`,
`OIDC_CLIENT_ID` and `OIDC_CLIENT_SECRET`.