This is an example Maven project which can be packaged to provide a custom theme (or themes) for KeyCloak.
- Modify the
groupId,artifactId, andversionin the Maven POM file to be unique for your organization. - KeyCloak themes generally extend from one another, and this example extends from the
keycloaktheme which is built-in to KeyCloak.- If you are using Red Hat SSO, change the
parentinsrc/main/resources/theme/<theme name>/<type>/theme.propertiesto berh-sso.
- If you are using Red Hat SSO, change the
- Each theme can contain one or more types like
account,login,email, etc...- Each type gets it's own subdirectory under the
src/main/resources/theme/<theme name>directory - Each theme & type needs to be listed in the
src/main/resources/META-INF/keycloak-themes.json{ "themes": [{ "name" : "mytheme", "types": [ "account" ] }] }
- Each type gets it's own subdirectory under the
- Each type directory can contain a
messagesdirectory where you can place an properties file for each language you wish to support.- e.g.
messages_en.propertiesfor English, and each line is in the form ofpropertyName=String Value
- e.g.
- Each type directory can contain a
resourcesdirectory where you can place static content like JavaScript, images, and css. - Each type directory MUST have a
theme.propertiesfile if it is extending another theme likekeycloakorrh-sso.- If you are writing a theme from scratch, you should not be using this starter.
- Package your theme as a JAR file
mvn clean package
- Copy the JAR file to
<keycloak>/standalone/deployments/
Once this is complete and you log in to the KeyCloak admin console you will be able to select <theme name> from the list of options as shown below:
