Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extending Keycloak theme

I would like to create a custom theme for keycloak for replacing some user-facing pages with a different style. The keycloak manual describes this process of Creating a Theme and recommends to derive a custom theme from an existing one.

For doing that, the docs reference in the Theme Properties this properties:

  • parent - Parent theme to extend
  • import - Import resources from another theme

with an example of

parent=base
import=common/keycloak

Unfortunately, the docs do not describe how that theme-extension does actually work (or I don't get it...).

Does the "parent=base" automatically use all files from that theme and just overlays those from the new theme?

What does the "import=common/keycloak" reference? I can't find any component or file path in the base theme where that would match.

like image 366
joergd Avatar asked Jun 19 '19 07:06

joergd


People also ask

Should I extend the Keycloak theme or base theme?

Most likely you will want to extend the Keycloak theme, but you could also consider extending the base theme if you are significantly changing the look and feel of the pages. The base theme primarily consists of HTML templates and message bundles, while the Keycloak theme primarily contains images and stylesheets.

Why choose Keycloak for your identity and access management platform?

Custom Themes Mostly, organizations want a custom theme for their Identity and Access Management Platforms. Keycloak provides theme support for web pages and emails. This allows customizing the look and feel of end-user facing pages so they can be integrated with the application.

How to customize the welcome page in Keycloak?

To enable that, we need to make a few changes to Keycloak's standalone.xml in the standalone/configuration folder: Similar to how we customized the account theme here, to change the look and feel of the other theme types, we need to add new folders called admin, email, or login, and follow the same process. 2.5. Customizing the Welcome Page

Where can I find the account management page in Keycloak?

The account management page is available at http://localhost:8083/auth/realms/baeldung/account and we can access it using the following credentials: [email protected] / 123. 4. Conclusion In this tutorial, we learned about themes in Keycloak – their types and structure.


2 Answers

When you say parent=base you are extending the base theme.

In your theme.properties the import=common/keycloak imports all the resources from keycloak theme of type common

you can find resources in <KEYCLOAK-HOME>/themes/keycloak/common

like image 97
ravthiru Avatar answered Oct 10 '22 14:10

ravthiru


If any of you is interested, I created a theme builder that let you extend the default Keycloak theme... or create a new one from scratch. Example:

enter image description here

Checkout Keycloakify

like image 30
Joseph Garrone Avatar answered Oct 10 '22 14:10

Joseph Garrone