Search code examples
javasingle-sign-onkeycloakkeycloak-services

How do I customize keycloak AccountPages?


I develop a customize spi_keycloak.

And It deployed successfully. but for some perposes I want to edit (add/delete) pages in AccountPages.

So for show what I want change, see this picture, I want to edit items(content) and menu in left.

enter image description here

How do I build and deploy in my keycloak.

In other words, when I access the /auth/realms/abc/account page, I can see there is a sidebar menu on the left with options like: “Account”, “Password”, “Authenticator”, and so on. I would like to add a new item in that sidebar and be able to access through something like /auth/realms/abc/account/custom


Solution

  • Keycloak 12 was released recently and allows you to write custom React code in the account console. This is the recommended way to go for newer keycloak versions. You can customise the new account console as shown in the keycloak quickstarts.

    For older keycloak versions you can customise the account console by adding a custom theme. You can use the existing base template for inspiration.

    Later edit: To create your custom rest endpoint please see keycloak rest extension example.

    This can be used for managing your extended keycloak data model using jpa entities. For an example see keycloak avatar extension.