Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to customize user_entity table used by keycloak?

I'm trying to use keyClaok for SSO. I set up mysql instead of embedded h2 database in keycloak.

However, there is a problem. On udemy lecture, lecturer told that it's not recommanded to handle db- table(created by keycloak) directly.

If business needs application handles user's several attributes (like modifying user's deparment, position, age, profile_img) , how to develop this needs with database in keycloak?

If i choose to use keycloak, should i consider that database (which application use) and the other database (which keycloak use) are apart? which means USER-DOMAIN is isolated from other domain

like image 920
KELIXO DO Avatar asked Sep 10 '25 22:09

KELIXO DO


1 Answers

You have two options. If the amount of data is not considerable and have a simple name=value structure, you can just use the user attribute in Keycloak. It's like a map of data attached to each user. The other solution is to keep the data in your own repository and implement a custom UserStorageProvider that queries your database to fetch users (including extra properties). Keycloak documentation already has an example of this provider.

like image 175
zaerymoghaddam Avatar answered Sep 13 '25 12:09

zaerymoghaddam