mrparkers / terraform-provider-keycloak

Terraform provider for Keycloak
https://registry.terraform.io/providers/mrparkers/keycloak/latest/docs
MIT License
612 stars 300 forks source link

User Attribute multivalued mapper not parsing properly when set from Identity Provider mapper #815

Open jbarbadillo opened 1 year ago

jbarbadillo commented 1 year ago

I have seen many related issues with multivalued mappers, but not this exact case, so I will try to explain the problem which I think it is a bug.

Scenario: Keycloak 16.1.1. We have an identity provider configured, mapping some attributes. One of those attributes is a multivalued User Attribute, and we use a Hardcoded Attribute Identity Provider Mapper, this way

image

Users are properly created, and the User Attribute is created as expected. There is also a UserInfo mapper for client web, configured this way:

image

With this configuration we expect UserInfo with_claims to be an array, but surprisingly we receive this:

image

But! If we modify any user atribute using the UI console, after clicking save, we start receiving UserInfo's with_claims as an array.

image

Hypothesis: It seems like when creating the attribute from de Identity Provider mapper, it is not correctly saved or formatted internaly, but when doing so from the console, everything works as expected. This is preventing us from being able to correclty register users using external identity provider.