coreapp new --sso: sign-in through the Core's Authelia

A template overlay (templates/sso) registers the app as an OpenID Connect
client in Authelia's idproviders.yml (between markers, secret hashed by
the running Authelia), checks the configuration before restarting
Authelia and restores it if the check fails; uninstall removes the client.
The app reaches Authelia's https address through traefik (@TRAEFIK_IP@,
provided by the template's install and by redeploys). The example is a
standard-library Python OIDC client (code flow with PKCE). Tested by
install, redeploy, remove and reinstall, and a real sign-in in a browser.

Also: the postgres overlay appends to the base install, uninstall and
env.in; database names get a coreapp_ prefix (PostgreSQL reserves pg_*);
deploy waits until the app answers on its own address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 12:34:27 -07:00
co-authored by Claude Opus 5.5
parent 74bdc13f0f
commit 284f52fc29
19 changed files with 419 additions and 37 deletions
+21
View File
@@ -0,0 +1,21 @@
## 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`).
- `app.py` shows the whole flow with Python's standard library: `/login`,
`/auth/callback`, `/logout`. For a real app, use your framework's OpenID
Connect library with `OIDC_ISSUER`, `OIDC_CLIENT_ID` and
`OIDC_CLIENT_SECRET`.