Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with keycloak_openid_user_client_role_protocol_mapper resource #1016

Open
BenjaminDecreusefond opened this issue Nov 19, 2024 · 0 comments

Comments

@BenjaminDecreusefond
Copy link

Describe the bug

Hi !

I've been trying to manage roles with this resource by setting it as follow

resource "keycloak_openid_user_client_role_protocol_mapper" "client_roles_as_groups_mapper" {
  realm_id                    = data.keycloak_realm.accounts.id
  client_id                   = keycloak_openid_client.client.id
  client_id_for_role_mappings = keycloak_openid_client.client.id
  name                        = "client-roles-as-groups-mapper"
  claim_name                  = "groups"
  add_to_id_token             = true
  add_to_access_token         = true
  add_to_userinfo             = true
}

(don't pay attention to the claim name it is intended)

The issue is that the parameter client_id_for_role_mappings as its name would suggest and as the documentation would suggest is expecting an ID. Or after investigation in the UI it turns out that it is actually expecting a the Name of the keycloak client and does not return any errors when I set the id as a value.

In that effect, I think the documentation is very misleading and that the keycloak provider should throw an error when an ID is set ?

Kind regards !
Benjamin

Version

4.4.0

Expected behavior

Should create the resource properly and throw error when the wrong value is given :)

Actual behavior

Act as if the resource was properly deployed.

How to Reproduce?

No response

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant