3.5. Deploying Themes
Themes can be deployed to Red Hat Single Sign-On by copying the theme directory to themes
or it can be deployed as an archive. During development you can copy the theme to the themes
directory, but in production you may want to consider using an archive
. An archive
makes it simpler to have a versioned copy of the theme, especially when you have multiple instances of Red Hat Single Sign-On for example with clustering.
To deploy a theme as an archive you need to create a JAR archive with the theme resources. You also need to add a file META-INF/keycloak-themes.json
to the archive that lists the available themes in the archive as well as what types each theme provides.
For example for the mytheme
theme create mytheme.jar
with the contents:
- META-INF/keycloak-themes.json
- theme/mytheme/login/theme.properties
- theme/mytheme/login/login.ftl
- theme/mytheme/login/resources/css/styles.css
- theme/mytheme/login/resources/img/image.png
- theme/mytheme/login/messages/messages_en.properties
- theme/mytheme/email/messages/messages_en.properties
The contents of META-INF/keycloak-themes.json
in this case would be:
A single archive can contain multiple themes and each theme can support one or more types.
To deploy the archive to Red Hat Single Sign-On simply drop it into the standalone/deployments/
directory of Red Hat Single Sign-On and it will be automatically loaded.