terraform-provider-keycloak icon indicating copy to clipboard operation
terraform-provider-keycloak copied to clipboard

keycloak_openid_client_scope is not setting Assigned Type field

Open tp20165 opened this issue 2 years ago • 5 comments

In the Master realm, I am generating client scope using keycloak_openid_client_scope resource. It created scope with Assigned Type as None. I need to set it as Default. I don't see any option to set the assigned type. Am I missing anything?

tp20165 avatar Nov 29 '22 15:11 tp20165

I need this, too. Seems like in https://github.com/mrparkers/terraform-provider-keycloak/blob/10e59625b45741464ca3c34a3fba07011981e6a5/provider/resource_keycloak_openid_client_scope.go, the type field is missing.

This way, we can not create scopes that are default for every new client - which is a pain.

mrohlof-protofy avatar Jan 19 '23 09:01 mrohlof-protofy

It would be fine to have that.

I use keycloak_openid_client_default_scopes to set default client scopes für single clients like this:

resource "keycloak_openid_client_default_scopes" "client_default_scopes" {
  realm_id  = keycloak_realm.isium.id
  client_id = keycloak_openid_client.weave.id

  default_scopes = [
    "acr",
    "profile",
    "email",
    "roles",
    "web-origins",
    keycloak_openid_client_scope.groups_scope.name,
  ]
}

klauserber avatar Apr 12 '23 06:04 klauserber

keycloak_openid_client_default_scopes seems to have no effect for me.

The Assigned type for a custom keycloak_openid_client_scope remains to "None" in the GUI, despite the terraform apply running fine.

lesaux avatar Jun 28 '23 14:06 lesaux

Just checking if there was some progress on this ?

Thanks!

francoisauclair911 avatar Jul 13 '23 15:07 francoisauclair911

We also need this...

EDIT1: Looked at the APIs, it looks like you need to use /admin/realms/[realm]/default-optional-client-scopes / /admin/realms/[realm]/default-optional-client-scopes / /admin/realms/[realm]/default-default-client-scopes API, so we could change keycloak_openid_client_optional_scopes and keycloak_openid_client_default_scopes resources to make client_id optional to manage the realm defaults/optionals

hameno avatar Feb 26 '24 10:02 hameno