Keycloak falls back to the built-in login theme instead of the 'toilville' theme #170
Labels
No labels
build-dist
priority
P1
priority
P2
priority
P3
priority
P4
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Toilville/toilville-design#170
Loading…
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?
Keycloak can't find the
toilvilleLOGIN theme and falls back to the built-in one. This happens even though the theme volume is mounted at/opt/keycloak/themes/toilvilleinforge-keycloak.hcl.The sign-in page is a brand surface, which is why this is filed here. The theme source and the jobspec are not in this repo (the only Keycloak references here are in
udg/generators/archive/), so the fix itself probably lands in forge-ops.Acceptance criteria
toilvillelogin theme's source lives now. If it lives nowhere, decide whether UDG should generate it fromdist/toilville/skin.css.login/theme.properties, the realm'sloginThemeisn't set, or the theme cache is stale.Tracked as forge wish
54fda812.Still real (checked forge-ops 2026-10-20):
nomad/jobs/forge-keycloak.hcl:118mountsobservability/keycloak/themes/toilville.email/. There's nologin/tree and nologin/theme.properties, so Keycloak falls back to its built-in theme. That's the first acceptance candidate.Decision: UDG generates the login theme from
dist/toilville/skin.css, so there is a single source. forge-ops addslogin/theme.propertiesand the templates.To verify, sign in at sso.toilville.dev and see Sora and terracotta on cocoa, and confirm the realm's
loginThemein the Keycloak admin. Both of those are on me.Fix is on forge-ops branch
fix/keycloak-login-theme(fd03ee1), pushed with no PR: forge-ops auto-merges on the first green commit, so opening it ships it.What it adds:
login/theme overkeycloak.v2;dist/toilville/skin.csson main);bin/gen-keycloak-login-theme.py, which maps the UDG tokens onto PatternFly v5;--check. A control hand edit makes--checkfail.@peterswimm: open the PR when you're ready to deploy, then check the sign-in page in light and dark mode.
The theme PR is open: Toilville/forge-ops#732. It merges itself once CI is green.
After it deploys, open the sign-in page while signed out and check that it shows the Toilville skin in both light and dark mode.
Two of the three acceptance criteria are provably met. Verified live against
sso.toilville.devon 2026-10-28, not inferred from the PR.This issue still reads as an open investigation into three candidate causes. Two of them are settled, and the fix has been deployed since 2026-10-21 —
forge-ops#732merged that day and nobody has confirmed it since.Criterion 1 — where the theme source lives: answered
forge-ops, atobservability/keycloak/themes/toilville/, generated from the UDG toilville skin by the newbin/gen-keycloak-login-theme.py. The skin is vendored verbatim asudg-skin.cssand the generator emitstoilville-login.css, recording the sha256 of the skin it was built from.--checkfails on drift in either file, so this is a CI-gated artifact rather than a hand-maintained copy.So the answer to "if it lives nowhere, decide whether UDG should generate it" is: it does now, and UDG generates it.
Criterion 2 — why Keycloak didn't pick it up: answered, and both named suspects are cleared
The three candidates in the body were a missing
login/theme.properties, an unset realmloginTheme, and a stale theme cache.theme.properties— shipped in #732.loginTheme— set. The served sign-in page references/resources/kd1x4/login/toilville/.... That path segment is the resolved login theme, so Keycloak is selectingtoilville, not falling back. Worth noting for anyone maintaining this: nothing interraform/keycloak/setslogin_theme, so the realm setting is live-only and not declared in IaC. It will not survive a realm rebuild, and it is not drift-checked. That is a separate gap from this issue and probably wants its own ticket.Fetched just now:
login/toilville/css/toilville-login.csslogin/toilville/css/udg-skin.csslogin/toilville/fonts/Sora-Regular.ttflogin/toilville/fonts/Sora-Bold.ttfThe stylesheet does real work rather than merely loading — it maps UDG onto PatternFly v5 (
--pf-v5-global--BackgroundColor--100: var(--bg-surface),--pf-v5-global--Color--100: var(--text-primary), the font families, the primary/hover pair), and it declares two@font-faceblocks, which matters because the skin namesSorabut ships no@font-faceof its own.Criterion 3 — the only one left, and it needs eyes
Nothing above proves it looks right, only that the right bytes are being served. Still open.
Worth checking dark mode specifically.
toilville-login.csshandles it with:root, :root.pf-v5-theme-darkand relies on UDG's ownprefers-color-schemeswitch, on the stated assumption that "Keycloak's darkMode switches PF the same way, so the two stay in step". That assumption is untested. If light renders correctly and dark does not, that is a real finding rather than a missed step.