Customize user table used by Keycloak

63 views Asked by At

Is it recommended to customize keycloak database to add some tables and columns or there is another method to do that.

I don't want to use that attributes table to add data about user. I want to add extra field to the user table like address and phone number..etc

1

There are 1 answers

0
The.Laughing.Man On

I've worked with many off the shelf systems including ones that were highly modified to meet specific business needs. Don't do it.

Find a way to aggregate the data you are interested in your own system and tie it to Keycloak. Don't modify Keycloak.

Every modification you make to Keycloak will drastically increase future maintenance and upgrades by an exponential amount. There will even be a point where upgrades will not be possible without trashing your existing instance and starting over.

If there is no way around it, here are a few tips to improve maintainability:

  • Organize modifications in a similar way throughout the project, preferably all together in their own section.
  • Include inline notes and indicators where modifications begin and end, what the changes were and why you made them.
  • Keep documentation outside of the project on modifications to track them all in one place.