Phase 3: Keycloak OIDC authentication #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Decomposed from #1 — Phase 3 of 4. Depends on #2 (scaffold).
Repo
forgejo_admin/pal-enterprisesUser Story
As a user with a Keycloak account, I want to log in via SSO so that I'm authenticated across all pal-e platform tools.
Context
Integrate Keycloak OIDC using the
omniauth-openid-connectgem. Register a new clientpal-enterprisesin thepal-eKeycloak realm (followsop-keycloak-client-creation). Handle login, callback, and logout flows. Store minimal session data (sub, name, email) — no local user table.This is the SSO gateway: once authenticated here, the user's Keycloak session applies across all pal-e realm apps.
File Targets
Files to create/modify:
Gemfile— addomniauth,omniauth-openid-connect,omniauth-rails_csrf_protectionconfig/initializers/omniauth.rb— Keycloak provider configapp/controllers/sessions_controller.rb— create (callback), destroy (logout)config/routes.rb— add/auth/keycloak/callback,/logoutFiles to modify:
app/views/pages/home.html.erb— wire "Sign In" button to/auth/keycloakapp/views/layouts/application.html.erb— show user name + logout when authenticatedk8s/dev.yaml— add KEYCLOAK_* env vars to secretAcceptance Criteria
pal-enterprisesregistered inpal-erealm/dashboard(or/until Phase 4)https://pal-enterprises.tail5b443a.ts.net/auth/keycloak/callbackTest Expectations
bin/rails testConstraints
pal-eatkeycloak.tail5b443a.ts.netsop-keycloak-client-creationfor client registrationomniauth-rails_csrf_protectionChecklist
Related
pal-enterprises— projectsop-keycloak-client-creation— SOP for client registrationDone — Keycloak OIDC wired up via
omniauth-openid-connect, callback + session flow working. See commit426030c.