Skip to content

data.keycloak_openid_client_scope cannot resolve dedicated OIDC client scopes #1621

Description

@arichtman-srt

Describe the bug

When attempting to retrieve the default client scope associated with an OIDC client, the data resource fails.

Version

26.5.2

Expected behavior

Data resource resolves the dedicated client scope created when an OIDC client is created.

Actual behavior

Fails to locate the dedicated client scope.

Error: expected provided client scope name to match 1 scope, but matched 0 scopes

How to Reproduce?

resource "keycloak_openid_client" "client" {
  realm_id = var.realm_id
  client_id = "foo"
  name = "bar"
  ...
}

data "keycloak_openid_client_scope" "dedicated_client_scope" {
  realm_id = var.realm_id
  name     = "${keycloak_openid_client.client.client_id}-dedicated"
}

Anything else?

Suspect dedicated client scopes are at a different path/endpoint, GUI/console shows https://$ADDRESS/admin/master/console/#/$REALM/clients/$CLIENT_UUID/clientScopes/dedicated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions