Skip to content

OIDC Client examples from docs don't work anymore #1325

@thomasdarimont

Description

@thomasdarimont

Describe the bug

The current example OIDC client configuration causes an error on terraform apply.

Version

26.3.4

Expected behavior

The example client configuration should just work.

Actual behavior

No response

How to Reproduce?

resource "keycloak_openid_client" "openid_client" {
  realm_id            = keycloak_realm.realm.id
  client_id           = "test-client"

  name                = "test client"
  enabled             = true

  access_type         = "CONFIDENTIAL"
  valid_redirect_uris = [
    "http://localhost:8080/openid-callback"
  ]

  login_theme = "keycloak"

  extra_config = {
    "key1" = "value1"
    "key2" = "value2"
  }
}

terraform apply yields:

keycloak_realm.test: Creating...
keycloak_realm.test: Creation complete after 1s [id=gh-1162]
keycloak_openid_client.openid_client: Creating...
╷
│ Error: valid_redirect_uris cannot be set when standard or implicit flow is not enabled
│
│   with keycloak_openid_client.openid_client,
│   on main.tf line 32, in resource "keycloak_openid_client" "openid_client":
│   32: resource "keycloak_openid_client" "openid_client" {
│
╵

The cause is that the example does not specify standard_flow_enabled = true. However, standard_flow_enabled is set to true by default in Keycloak when a new client is created.

Anything else?

We should update the documentation and fix the defaults for the OIDC client configuration.

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