Modifying account management console

Hello all,

I am trying to figure out what is the best way to modify the account management theme.

I am using their new theme, called keycloak-man), built with react and patternfly. It should be straightforward, but I have several problems. The first one is that the content is not updated when I change something in the code. Even the code that should not require compilation doesn’t seem to register changes. I tried restarting the KC server, using npm run build but nothing seems to have an effect. I also delete everything from local storage, cookies and stuff like, removing node modules and reinstalling everything.

Any ideas what could be the problem? Did someone played around with this and manage to modify it successfully?

Didn’t play with the account-console theme yet, but most likely it’s related to some caching (which might also have impacts on headers and therefore the caching of the browser…):
https://www.keycloak.org/docs/latest/server_development/#creating-a-theme

1 Like

Hello @dasniko! You are right, when I disabled caching everything worked as expected, at least when it comes to reloading content. Do you by any chance know should it be possible to call keycloak’s REST API from inside the account management console? For example if I want to show users roles or groups he is a member of?
Because when I try that, I get 403 error. Thank you for the help.

The REST API ist the ADMIN REST API and isn’t for usage by regular users.
Try to call the /userinfo endpoint with the users access_token and map the needed data into this endpoint (via protocol mappers). This way, you should be able to retrieve the desired data.

Thank you once again Niko, I will try to do it like that. I was expecting that there will be an easier way, considering that the user is trying to read its own data and is already logged in. But since I am new to this, I don’t quite yet understand it properly.