mrparkers / terraform-provider-keycloak

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

Add endpoint discovery to realm #918

Open mingfang opened 6 months ago

mingfang commented 6 months ago

Keycloak implements the OIDC Discovery specification. The metadata endpoint is a <base URL>/.well-known/openid-configuration. This endpoint returns all the other endpoints that are needed by applications, like this one https://github.com/mrparkers/terraform-provider-keycloak/blob/master/example/external_token_exchange_example.tf#L27

With the new endpoint discovery feature, that code may look like this

  authorization_url  = keycloak_realm.token-exchange_source_realm.authorization_url

or like this, if we want to put all the endpoints in one place

  authorization_url  = keycloak_realm.token-exchange_source_realm.endpoints.authorization_url