2
votes

I have a KeyCloak 12.0.2 application running on docker. Now I am trying to update the themes for login screens for the Realms. Whenever I go and change the theme from Realm theme setting - UC1 - Open KeyCloak instance, the properly selected theme login page will appear. No issues! UC2 - Open my application, click login, and the login page will have KeyCloak theme always, even though I tried selecting the different theme for a master or the specific Realm.

This is the theme which is appearing on my login screen whenever I go here from any application which is configured to use KeyCloak as SSO, its regardless of which theme I select from the Realm setting always-

enter image description here

I have checked and configured on the KeyCloak login screen, the theme will change as per the selection of themes for the Master realm -

enter image description here

I have made changes into the standalone.xml file related to the theme cache as follows -

<theme>
                <staticMaxAge>-1</staticMaxAge>
                <cacheThemes>false</cacheThemes>
                <cacheTemplates>false</cacheTemplates>
                <welcomeTheme>${env.KEYCLOAK_WELCOME_THEME:keycloak}</welcomeTheme>
                <default>${env.KEYCLOAK_DEFAULT_THEME:keycloak}</default>
                <dir>${jboss.home.dir}/themes</dir>
            </theme>

I am kind of stuck here as I have to add multiple themes based on the Realms I have in the KeyCloak. I also tried to restart the container in which KeyCloak is running but no luck.

1

1 Answers

7
votes

After lots of digging, I found out that I was changing the theme in the wrong place. To update the theme of the SSO login page, you need to select the theme using - Realm -> Clients -> Appropriate Client Name -> Theme.

enter image description here

If you try to change the theme using Realm -> Realm Settings ->Themes, only the login screen for the Admin console will change.