4. Add Custom Theme¶
Custom themes are added to a realm by
- adding the theme directory to
/opt/keycloak-3.1.0.Final/themes - selecting the theme via Admin Web UI >> Realm Settings >> Themes
Each theme is selectable based on the directory name of the theme. Themes can extend other themes.
Here are two links to get started with a custom theme:
- Currently version v0.0.1 of OSC’s Keycloak theme
can be used as a starting point for modification. This theme is based off of
the default
keycloaktheme which itself is based off thebasetheme. Files to modify include:login/login.ftlfile for the footer links: https://github.com/OSC/keycloak-theme/blob/v0.0.1/login/login.ftl#L63-L73login/resources/img/ondemand-logo.pngadd a logo with this name herelogin/resources/img/favicon.icoreplace with your own or removelogin/messages/messages_en.propertiesreplace text with text appropriate for your center
- See the Keycloak documentation for themes: http://www.keycloak.org/docs/3.1/server_development/topics/themes.html
Remember after adding a theme you still need to configure your realm in the Keycloak admin UI to use the theme for the login pages.
Note
Soon we will offer an ood-keycloak base theme that be easier to extended to provide most of the common themeing a site might like to perform. It will also work well for OTP views.