Skip to content

Dovlash/keycloak-theme-template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keycloak-theme-template

Base template for developing a Keycloak theme.

Developing custom Keycloak themes

  • Create a folder for your custom theme within the src/main/resources/themes directory, if one does not already exist.
  • Then add a subdirectory for the theme type (e.g. admin, login, etc.).
  • Modify any of the files within your custom theme directory. Assuming you are extending the base or keycloak theme, you only need to override the files you want to change.
  • To easily iterate without having to restart the server every time, load keycloak from docker with a script that turns theme caching off:
docker run --name keycloak-theme -d -p 9000:8080 \
    -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin \
    --mount type=bind,source=$(pwd)/src/main/resources/theme/example/,target=/opt/jboss/keycloak/themes/example \
    -v $(pwd)/docker/no-cache-theme.cli:/opt/jboss/startup-scripts/no-cache-theme.cli \
    quay.io/keycloak/keycloak:16.1.0

Testing your theme

  • Login to the admin console at http://localhost:9000/auth/admin with admin:admin
  • Go into Realm Settings->Themes and select the theme you are working on (e.g. Login->example)

Packaging the theme for deployment

  • Run mvn package to build a jar that can be placed in the standalone/deployments directory of your Keycloak installation.

About

Starter for building a Keycloak theme

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • FreeMarker 88.9%
  • CSS 11.1%