Skip to content

docs(auth): runbook Keycloak — SPID + registrazione email-OTP (#235 Fase 5) - #243

Merged
gzileni merged 1 commit into
mainfrom
docs/keycloak-setup-235
Jul 21, 2026
Merged

docs(auth): runbook Keycloak — SPID + registrazione email-OTP (#235 Fase 5)#243
gzileni merged 1 commit into
mainfrom
docs/keycloak-setup-235

Conversation

@gzileni

@gzileni gzileni commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Fase 5 di #235. SPID e la registrazione con codice via email sono funzionalità di Keycloak (l'IdP), non della nostra app: questo runbook spiega come configurarle e collegarle.

docs/keycloak-setup.md

  • Divisione responsabilità: Keycloak = autenticazione · opendata.users.role + /admin = autorizzazione.
  • Realm opendata + client public PKCE opendata-ui, redirect https://<ui>/*, audience mapper opzionale (per OIDC_AUDIENCE).
  • Registrazione email+OTP: User registration + Verify Email/Email-OTP + SMTP; il frontend invia già prompt=create.
  • SPID: via aggregatore (SP certificato → broker OIDC/SAML in Keycloak) o plugin keycloak-spid; mapping attributi→claim; nota su CF come dato personale (§7 del pivot).
  • Primo admin via BOOTSTRAP_ADMIN_EMAIL; wiring env backend/frontend (issuer condiviso); checklist di verifica e2e; modalità dev senza IdP.
  • README: puntatore al runbook (R14).

Solo documentazione. Con questo, il codice di #235 è completo (Fasi 1–4 + 6 mergiate); la Fase 5 è operativa e si esegue quando c'è un Keycloak da configurare.

Closes #235

🤖 Generated with Claude Code

…ase 5)

Fase 5 = configurazione IdP, non codice app. docs/keycloak-setup.md: realm/client
public PKCE, redirect URI, audience mapper opzionale, registrazione con verifica
email/OTP, SPID via aggregatore o plugin keycloak-spid, ruoli nel nostro DB +
BOOTSTRAP_ADMIN_EMAIL, wiring env OIDC_ISSUER/NEXT_PUBLIC_OIDC_*, verifica e2e,
modalita dev senza IdP. README: puntatore al runbook nella sezione auth (R14).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32b31f4c49

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/keycloak-setup.md
Browser (opendata-ai-ui) ──OIDC Auth Code + PKCE──▶ Keycloak (realm opendata)
│ access_token (JWT) │ broker SPID
▼ └─ registrazione email+OTP
opendata-backend ──verifica JWT via JWKS ${OIDC_ISSUER}/.well-known/jwks.json──▶

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fetch the Keycloak JWKS from discovery

In deployments following this Keycloak runbook, OIDC_ISSUER=https://<sso-host>/realms/opendata makes the backend call issuer.rstrip('/') + '/.well-known/jwks.json' (opendata-backend/src/opendata_backend/auth/clerk.py:_jwks_client), but Keycloak publishes realm signing keys at the discovery document's jwks_uri (.../protocol/openid-connect/certs), not at that suffix. As a result, every authenticated API call with a Keycloak token will fail at signing-key lookup; this needs either discovery-based JWKS lookup in the backend or a documented, tested Keycloak-compatible setting before telling operators this setup is ready.

Useful? React with 👍 / 👎.

@gzileni
gzileni merged commit c0ade8c into main Jul 21, 2026
27 checks passed
@gzileni
gzileni deleted the docs/keycloak-setup-235 branch July 21, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Architettura] Auth OIDC-neutrale (self-hosting PA) + rate limit di protezione

1 participant