Generate simple Keycloak customized theme using thor cli
- Ruby 2.7+
- Thor gem
- HTTParty gem
- ERB gem
- Docker (for running Keycloak)
- Execute main.rb :
$ ruby main.rb theme --name <theme_name> --color <color> --logo <logo>
Help is available with $ ruby main.rb help theme
- Copy the generated theme to the Keycloak theme directory
A new directory should be present in ./theme/
directory. Copy the content of this directory to the Keycloak theme directory.
-
Start Keycloak server
- Build the docker image:
$ make build
- Run the docker container:
$ make start
- Build the docker image:
-
Access the admin console
- Go to
http://localhost:8080
- Login with the admin credentials (username:
admin
, password:admin
)
- Go to
-
Go to the realm settings
-
Go to the themes tab
-
Select the new theme in the dropdown
-
Go to the login page and see the new theme
- Open a new incognito window
- Go to
http://localhost:8080/realms/master/account
- You should see the new theme
Note: The theme is only applied to the login page. The account page is not styled.
Note: You can modify theme directly and refresh page, changes will be applied thanks to Docker volume
- Execute main.rb :
$ ruby main.rb archive <version | 0.0.1>
- The JAR file will be generated in the
./dist/
directory