# How can one extend the user model itself?

**URL:** <https://forum.keycloak.org/t/how-can-one-extend-the-user-model-itself/14806>\
**Category:** Getting advice\
**Created:** [April 6, 2022, 8:34am UTC](https://forum.keycloak.org/t/how-can-one-extend-the-user-model-itself/14806 "2022-04-06T08:34:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eldarj](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/eldarj/32/4365_2.png) [@eldarj](https://forum.keycloak.org/u/eldarj)\
**Post date:** [April 6, 2022, 8:34am UTC](https://forum.keycloak.org/t/how-can-one-extend-the-user-model-itself/14806/1 "2022-04-06T08:34:45Z")

</div>

Is it possible to extend the user model itself in Keycloak?

I’d like to add a new field to the user model, that would also be persisted and stored in db.

---

<div class="post-metadata">

**Author:** ![ThoreKr](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/thorekr/32/7713_2.png) [@ThoreKr](https://forum.keycloak.org/u/ThoreKr)\
**Post date:** [April 8, 2022, 3:08pm UTC](https://forum.keycloak.org/t/how-can-one-extend-the-user-model-itself/14806/2 "2022-04-08T15:08:43Z")

</div>

There are many ways to achieve this, one of them is a custom implementation of the user model spi.

However, this approach is probably in conflict with currently ongoing efforts to move as much as possible into the attributes array of the user. Which is probably the easiest way to get the data persisted. This would also require you to modify the frontend in case you want to expose the information.

Currently in preview is the declarative user profile feature, which would allow you to configure the user attributes and its validators from the admin console.
