Custom themes
Documentation
On this page
Okivo's pages in Keycloak (device setup, sign-in approval) and the invitation email appear in your realm's
theme. With Keycloak's own themes (keycloak.v2, keycloak) this works out of the box. If you build your
own login or email theme, keep the points below in mind.
A complete example with a check script, a local Keycloak to try it and a brief for AI coding tools is on
GitHub: okivo-keycloak-theme-demo
(MIT license). Use the branch of your Keycloak version, for example keycloak-26.7.

Login theme
- Keep the page frame.
template.ftlmust provide the macroregistrationLayoutwith the sectionsheaderandformand show Keycloak's messages. The easiest way is to inherittemplate.ftlfromkeycloak.v2. - Do not copy Okivo's pages. Do not put
push-mfa-*.ftlinto your theme. A copy freezes the page at the current plugin version; later improvements no longer reach your users. Style the pages with CSS and change texts inmessages_<language>.properties. - Buttons. Set
kcButtonClass,kcButtonPrimaryClass,kcInputClassand bothkcButtonSecondaryClassandkcButtonDefaultClassintheme.properties. - QR code. Dark on white with a margin, also in dark mode; do not recolor or invert it.
- JavaScript. The pages need small scripts (QR code, copy, waiting for the approval). A
Content-Security-Policy without
'unsafe-inline'inscript-srcbreaks device setup.
Email theme
The invitation (“Set up Okivo” under Credentials → Credential reset) comes from the email theme okivo
in the plugin. Set parent=okivo in your email theme: the invitation keeps working and everything else
follows your theme. Change its texts with the keys okivoInvite… in messages_<language>.properties.
Check
The demo repository has a test checklist and the script tools/check-theme.sh, which checks your theme
against these rules. Walk through the checklist in a browser, light and dark, on a phone and a computer, in
every language of your realm. All selectors and message keys are in the
theme contract.