# Identity Provider: map claims to declarative user profile attributes

**URL:** <https://forum.keycloak.org/t/identity-provider-map-claims-to-declarative-user-profile-attributes/20555>\
**Category:** Miscellanaeous\
**Created:** [March 1, 2023, 8:53am UTC](https://forum.keycloak.org/t/identity-provider-map-claims-to-declarative-user-profile-attributes/20555 "2023-03-01T08:53:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lme](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/lme/32/7821_2.png) [@lme](https://forum.keycloak.org/u/lme)\
**Post date:** [March 1, 2023, 8:53am UTC](https://forum.keycloak.org/t/identity-provider-map-claims-to-declarative-user-profile-attributes/20555/1 "2023-03-01T08:53:15Z")

</div>

Hi,

I’m trying to switch from [custom user attributes](https://www.keycloak.org/docs/latest/server_admin/#proc-configuring-user-attributes_server_administration_guide) to the [feature preview declarative user profile](https://www.keycloak.org/docs/latest/server_admin/#user-profile).

Keycloak is connected to an OIDC Identity Provider with configured mappers of type “Attribute Importer” that map claims to custom user attributes. Now I would like to map claims to attributes created in the declarative User profile.  
Is this possible with Keycloak 21? If yes, what mapper type should I use for my OIDC Identify Provider?

Thanks.

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [March 1, 2023, 3:22pm UTC](https://forum.keycloak.org/t/identity-provider-map-claims-to-declarative-user-profile-attributes/20555/2 "2023-03-01T15:22:51Z")

</div>

It doesn’t matter if you have declarative user profile enabled or not, attributes are just - well, attributes. Only difference is, that with declarative profile, they are defined.  
Just use a mapper of type “Attribute Importer” and map the desired claim to your target attribute at a user and you are good to go.

---

<div class="post-metadata">

**Author:** ![lme](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/lme/32/7821_2.png) [@lme](https://forum.keycloak.org/u/lme)\
**Post date:** [March 1, 2023, 4:41pm UTC](https://forum.keycloak.org/t/identity-provider-map-claims-to-declarative-user-profile-attributes/20555/3 "2023-03-01T16:41:27Z")

</div>

Ok, nice. So basically I’ve nothing to do apart checking that attribute names defined in the declarative user profile match the target attribute names in my mappers.

An other question regarding the new declarative user profile: I saw that the declarative user profile is used in the admin console user form (in the admin console v2 only) and the register form to display dynamically generated forms, but my declarative profile is not displayed in the account console (v1 or v2). Is this the expected behaviour with Keycloak 21, or am I missing something?

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [March 1, 2023, 4:54pm UTC](https://forum.keycloak.org/t/identity-provider-map-claims-to-declarative-user-profile-attributes/20555/4 "2023-03-01T16:54:07Z")

</div>

AFAIK the account console is not (yet?) adapted to the declarative profile.  
Keep in mind that the user profile is still a preview feature, not yet fully supported. No, nobody knows when this will be the case. 😉

---

<div class="post-metadata">

**Author:** ![lme](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/lme/32/7821_2.png) [@lme](https://forum.keycloak.org/u/lme)\
**Post date:** [March 1, 2023, 5:19pm UTC](https://forum.keycloak.org/t/identity-provider-map-claims-to-declarative-user-profile-attributes/20555/5 "2023-03-01T17:19:28Z")

</div>

Yeah, I know declarative profile is still in a feature preview state 🙂

I was juste wondering if I was doing something wrong because [the doc](https://www.keycloak.org/docs/latest/server_admin/#user-profile) says:

> Dynamically render forms that users interact with like registration, update profile, brokering, and **personal information in the account console** , according to the attribute definitions and without any need to manually change themes

Anyway, this will be a great feature when it will be available and I’m glad I will be able to reuse my custom user attributes with this new feature (I was afraid of having to plan a complex migration from the legacy behaviour to the new declarative profile).

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [March 1, 2023, 5:36pm UTC](https://forum.keycloak.org/t/identity-provider-map-claims-to-declarative-user-profile-attributes/20555/6 "2023-03-01T17:36:11Z")

</div>

This has the milestone label `22.0.0`:

> <https://github.com/keycloak/keycloak/issues/16741>
>
> \### Description
> 
> See the checklist on https://github.com/keycloak/keycloak/iss…ues/16737 . There is separate label \`area/user-profile\`, which can be used to search for all issues related to user profile: https://github.com/keycloak/keycloak/issues?q=is%3Aissue+is%3Aopen+label%3Aarea%2Fuser-profile
> 
> \- \[\] Enable user profile by default for new realms
> \- \[\] Review and update the test suite to run tests against realms with user profile enabled
> \- \[\] Review documentation to make sure we are covering all aspects of user profile
> \- \[\] Review documentation to cover the main aspects when migrating from legacy to the declarative user profile
