I have made a custom theme for Keycloak and I'd like to set a specific realm to use that theme for the login page and enable internationalization without using admin console, mainly because I want to make it automatic as the realm creation based on the JSON import.
It seems the JSON file is unable to handle theme configuration, is there any way to make this configuration without any human action?
Login to Keycloak admin and select realm, then go to the theme and select the custom option for the login theme. Remember that the custom option in login will be visible only after adding the custom folder on the path, as explained earlier. This is it!
A realm manages a set of users, credentials, roles, and groups. A user belongs to and logs into a realm. Realms are isolated from one another and can only manage and authenticate the users that they control. clients. Clients are entities that can request Keycloak to authenticate a user.
Let's try to change the logo to our own. For that, we need to add a new folder, account inside the themes/custom directory. We'll rather copy it from the themes/keycloak directory so that we have all the required elements.
You can use Keycloak CLI to specify a theme for realm. Keycloak CLI executable (kcadm.bat
or kcadm.sh
) is placed in the /bin
directory
First, you need to login with admin credentials:
kcadm config credentials --server http://localhost:8080/auth --realm master --user admin --password ADMIN_PASSWORD
Then you need to update corresponding realm, setting its loginTheme attribute:
kcadm update realms/REALM_NAME -s "loginTheme=REALM_LOGIN_THEME_NAME"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With