Identity Provider: map claims to declarative user profile attributes

Hi,

I’m trying to switch from custom user attributes to the feature preview declarative 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.

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.

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?

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. :wink:

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

I was juste wondering if I was doing something wrong because the doc 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).

This has the milestone label 22.0.0:

1 Like