Repository navigation
How to perform simple customization to the account theme? #55529
|
Hi, we are currently using only Keycloak's login page. To align it with our corporate identity we customized the theme with Keycloakify. Now we would like to give users the opportunity to use the account console as well, e.g. for configuring MFA, passkeys etc. Customizing the account console seems to be discouraged by the Keycloakify-project and we do not want a whole lot of maintenance with this. We would be okay if we could just switch the Keycloak logo with our own logo. Is there a simple, non-intrusive way to do this (with or without Keycloakify)? |
Replies: 4 comments
|
If you only need to swap the logo (and maybe tweak a few colors), you don't need Keycloakify or a React rebuild for the account console. You can ship a minimal extending theme on top of Directory layout (mounted under
parent=keycloak.v3
logo=/img/logo.svg
logoUrl=https://your-company.example.com
styles=css/styles.cssThen set Realm settings -> Themes -> Account theme to A few pitfalls to keep in mind:
|
|
Keycloak has a built-in Quick Theme tool for logo and color changes. If your version exposes it, you can try it on a development server with To try the generated theme, place the JAR in If you prefer the small, hand-written theme above, omit |
|
Both Pusri27 and leongaooo have achieved a good balance by restricting the Login theme to just Keycloakify; and then setting a simple extending theme within the Realm settings → Themes so that the account console can be personalised without having to fork the SPA. Consider these aspects when deciding on which method to implement: Minimal extending theme (parent=keycloak.v3) By simply using theme.properties (alongside logo, logoUrl and/or styles) and static files, there is no need to manage PatternFly/SPA code or complex CSS which may change with new Keycloak versions. Quick Theme (--features=quick-theme) This is useful if wishing to provide a UI for easily creating an extending theme JAR for modifying logo and colour. However, as this is a pre-release feature, it is advisable to initially trial it on a development or staging environment. Once done, it can be included in your deployed solution in the same way as any bespoke provider JAR. Presentation and cache issues Ensure that your logo is correctly displayed and sized in both light and dark themes (note that by default the account page header is dark). In addition, whilst locally developing, turn off caching for your theme and static resources so that changes to theme.properties or images are visible without delay. |
|
Thanks for the responses! I ended up doing a mix of your propositions. I started out by creating a theme with the Quick Theme tool and now I am refining it by editing the resources in the JAR file directly and rebuilding it manually. |
If you only need to swap the logo (and maybe tweak a few colors), you don't need Keycloakify or a React rebuild for the account console. You can ship a minimal extending theme on top of
keycloak.v3using justtheme.propertiesand your static assets.Directory layout (mounted under
themes/or packaged in a JAR withMETA-INF/keycloak-themes.json):theme.properties:Then set Realm settings -> Themes -> Account theme to
m…