- Updated targetAppFromReturnTo function to handle OIDC authorization unwrap and added search parameter processing. - Integrated target app resolution into the OIDC route for improved audit logging of SSO handoffs. - Added a test case to verify the logging of the target app during the authorization process. - Updated documentation to reflect changes in audit logging for the Technitium DNS application. Co-authored-by: Cursor <cursoragent@cursor.com>
4.1 KiB
Интеграция auth-portal ↔ Technitium DNS Server
App id: dns. Auth mode: OIDC (не JWT fragment).
Technitium DNS Server v15.2+ поддерживает SSO через OpenID Connect. Ссылки: Technitium DNS, Authelia guide, Pocket ID.
Permissions (portal)
| Permission | OIDC group | Technitium Local Group |
|---|---|---|
dns:console:admin (или portal is_admin) |
technitium_admins |
Administrators |
dns:dns:write |
technitium_dns_admins |
DNS Administrators |
dns:dhcp:write |
technitium_dhcp_admins |
DHCP Administrators |
Claims groups и roles отдаются в id_token и UserInfo.
Portal checklist
- Admin → Пользователи: выдать app
dnsи нужные права - Admin → Ссылки приложений: URL Technitium (
https://dns.…) - Admin → OIDC-клиенты: создать client
- Redirect URI:
https://<dns-host>/sso/callback - Scopes:
openid profile email groups
- Redirect URI:
- Сохранить
client_id/client_secret(секрет показывается один раз) RETURN_TO_ALLOWLIST— origin Technitium (для App Switcher / аудита)
Technitium SSO
- Локальный admin (break-glass) оставить
- Administration → Sessions → Single Sign-On (или SSO Providers)
- Включить SSO:
| Field | Value |
|---|---|
| Metadata Address | https://<auth-host>/.well-known/openid-configuration |
| Authority / Issuer | https://<auth-host> (как в Admin → OIDC) |
| Client ID | из portal |
| Client Secret | из portal |
| Scopes | openid profile email groups |
| Allow Signup | Enabled |
| Allow Signup Only For Mapped Users | Enabled |
- Group Map:
| Remote | Local |
|---|---|
technitium_admins |
Administrators |
technitium_dns_admins |
DNS Administrators |
technitium_dhcp_admins |
DHCP Administrators |
- Save (web service перезапустится)
DNS pitfall
Technitium резолвит back-channel OIDC (discovery / token / JWKS) через свой DNS, не через OS /etc/hosts.
Если auth.* только split-horizon — добавьте A/AAAA на Technitium и проверьте:
dig +short @127.0.0.1 auth.example.com
См. Discussion #1988.
Контейнер auth-portal (production)
OIDC поднимается вместе с приложением — отдельный контейнер не нужен.
| Env | Назначение |
|---|---|
ISSUER / OIDC_ISSUER |
Публичный HTTPS URL портала (https://auth.shnt.top) |
OIDC_RSA_PRIVATE_KEY |
Опционально; иначе ключ в SQLite volume ./data |
RETURN_TO_ALLOWLIST |
Origin Technitium (https://dns.shnt.top) |
Traefik-стек: deploy-traefik.md · deploy/env.traefik.example · deploy/docker-compose.traefik.yml.
Локально:
docker compose up -d --build
curl -fsS http://localhost:8080/.well-known/openid-configuration | head
После деплоя: Admin → OIDC-клиенты → redirect https://<dns-host>/sso/callback.
App Switcher
Для dns режим authMode: oidc — открывается базовый URL (кнопка OpenID Connect на логине Technitium), без #access_token.
Журнал входов портала: при выдаче authorization code пишется auth.sso_handoff с target_app: dns (колонка «Приложение» → Technitium DNS).
Endpoints portal (IdP)
GET /.well-known/openid-configurationGET /.well-known/jwks.jsonGET /oauth/authorizePOST /oauth/token(client_secret_post/client_secret_basic)GET /oauth/userinfo