Forgejo and Grafana sign-in through Keycloak #574

Stängd
öppnade 2026-10-08 14:52:41 +00:00 av supernaut · 2 kommentarer
Ägare

Point Forgejo and Grafana at Keycloak.

  • Forgejo: update the existing source Bitborg Auth in place with forgejo admin auth update-oauth (discovery URL under /realms/bitborg/, new secret, --group-claim-name groups --admin-group forgejo_admins). Same source id, so accounts keyed on sub stay linked.
  • Teach tasks/oidc-source.yml to update an existing source, not only add one.
  • Grafana: auth, token and userinfo URLs under /realms/bitborg/protocol/openid-connect/. Role expression on groups.
  • Verify on staging: sign in to both with a passkey and with password plus TOTP.

Done when: both services sign in through Keycloak on staging and existing linked accounts resolve.

Depends on: #571
Epic: bitborg/bitborg-docs#127

Point Forgejo and Grafana at Keycloak. - [x] Forgejo: update the existing source `Bitborg Auth` in place with `forgejo admin auth update-oauth` (discovery URL under `/realms/bitborg/`, new secret, `--group-claim-name groups --admin-group forgejo_admins`). Same source id, so accounts keyed on `sub` stay linked. - [x] Teach `tasks/oidc-source.yml` to update an existing source, not only add one. - [x] Grafana: auth, token and userinfo URLs under `/realms/bitborg/protocol/openid-connect/`. Role expression on `groups`. - [x] Verify on staging: sign in to both with a passkey and with password plus TOTP. Done when: both services sign in through Keycloak on staging and existing linked accounts resolve. Depends on: #571 Epic: bitborg/bitborg-docs#127
Upphovsperson
Ägare

Forgejo and Grafana sign-in through Keycloak is already implemented behind kanidm_enabled. Prod keeps true, so nothing switches before #575.

  • Forgejo: oidc-source.yml updates the existing OAuth2 source in place (update-oauth --id), so the source id and linked accounts stay. The name becomes Bitborg-id. The forgejo client's redirect is /user/oauth2/Bitborg-id/callback. Group claim groups, admin group forgejo_admins.
  • Grafana: OAuth URLs under /realms/bitborg/protocol/openid-connect/. The role expression reads groups (grafana_admins). The podman secret follows vault_keycloak_grafana_client_secret and rotates when it changes.
  • The grafana client is in opentofu/keycloak and enabled for prod.
  • #655 fixed stale comments and lists the vault keys in the runbook "Cutover switch".

For the cutover window: the prod realm apply, the vault keys, flipping keycloak_enabled: true together with kanidm_enabled: false (keycloak_enabled is false on prod today), and the reconciler v2 tag.

Forgejo and Grafana sign-in through Keycloak is already implemented behind `kanidm_enabled`. Prod keeps `true`, so nothing switches before #575. - Forgejo: `oidc-source.yml` updates the existing OAuth2 source in place (`update-oauth --id`), so the source id and linked accounts stay. The name becomes `Bitborg-id`. The `forgejo` client's redirect is `/user/oauth2/Bitborg-id/callback`. Group claim `groups`, admin group `forgejo_admins`. - Grafana: OAuth URLs under `/realms/bitborg/protocol/openid-connect/`. The role expression reads `groups` (`grafana_admins`). The podman secret follows `vault_keycloak_grafana_client_secret` and rotates when it changes. - The `grafana` client is in `opentofu/keycloak` and enabled for prod. - #655 fixed stale comments and lists the vault keys in the runbook "Cutover switch". For the cutover window: the prod realm apply, the vault keys, flipping `keycloak_enabled: true` together with `kanidm_enabled: false` (`keycloak_enabled` is false on prod today), and the reconciler v2 tag.
Upphovsperson
Ägare

Done at the cutover on 2026-10-11 (#659 B4 and B5). Prod: the Forgejo source was updated in place (id 2, now Bitborg-id, linked accounts kept: before/after snapshot identical), and Grafana signs in through Keycloak. An operator account signed in to Forgejo, the portal and Grafana with a passkey. Staging covered password plus TOTP. Closing.

Done at the cutover on 2026-10-11 (#659 B4 and B5). Prod: the Forgejo source was updated in place (id 2, now `Bitborg-id`, linked accounts kept: before/after snapshot identical), and Grafana signs in through Keycloak. An operator account signed in to Forgejo, the portal and Grafana with a passkey. Staging covered password plus TOTP. Closing.
Logga in för att delta i denna konversation.
Ingen milstolpe
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-infra#574
Ingen beskrivning angiven.