Search code examples
keycloakkeycloak-services

Change and extend keycloak Admin UI


There are lot of resources on how to create templates for the welcome screen, login and email etc but so far I have not been able to find anything how can I customize and extend the admin client itself.

What I want to do is:

Create some custom entities in keycloak database, and be able to view and edit them directly in the keycloak admin UI

From the code that comes with keycloak, it seems that they have used angular to create the admin UI, but it looks like the production version of the angular app. Are there any resources where I can get access to the dev version of the app, so can play around and build custom view and fields in the admin UI?

I believe once I have access to that, I can find my way through to how to access the data from my custom entities, but any pointers to that would also be great!

PS: I have read the docs and have been successful in creating custom entities in keycloak, it's just the admin UI part where I do not see any available resources.

Thanks!


Solution

  • After researching alot and trying out various approaches, I have come to the following conclusion:

    The best option to extend Keycloak for extra functionality is to not extend it at all.

    When using Keycloak it serves a specific purpose. I have learned it that hard way, it is better to implement a microservice/module (whatever you wanna call it) that extends Keycloak functionality by leveraging its Admin APIs.

    By doing this, we can add whatever extra functions we want, eg. user Profile Image, custom user profile pages, custom admin pages, etc using the products UI theme without messing around with Keycloak.

    Advantages are:

    1. Easier to update Keycloak
    2. Can allow fine tuned access to Users to their profiles and data
    3. Can allow fine tuned access to admins without exposing everything Keycloak offers, which might be overwhelming to certain admins.
    4. Admin APIs are relatively stable and often do not introduce breaking changes

    This ofcourse does not work if you want a specific claim added directly to the JWT token, based on the extension.

    For this reason, I would recommend having a look at the following github project. I used this generate and achieve what I wanted.