mrparkers / terraform-provider-keycloak

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

support `display_on_consent_screen` in `keycloak_openid_client_scope` #967

Closed missedone closed 1 month ago

missedone commented 1 month ago

sample openid client scope:

resource keycloak_openid_client_scope example {
  realm_id                  = keycloak_realm.realm.id
  name                      = "example"
  description               = "Example OpenID Connect scope"
  include_in_token_scope    = false
  display_on_consent_screen = true
}

got the error when run terraform plan:

An argument named "display_on_consent_screen" is not expected here.

checked around the source code, see display_on_consent_screen only available in keycloak_openid_client https://github.com/mrparkers/terraform-provider-keycloak/blob/master/provider/resource_keycloak_openid_client.go#L223-L227

Keycloak version: 24.0.4

missedone commented 1 month ago

after checking the source code https://github.com/mrparkers/terraform-provider-keycloak/blob/master/provider/resource_keycloak_openid_client_scope.go#L64-L66

looks like we just need to set a non-empty value to

the above snippet need to be updated as below:

resource keycloak_openid_client_scope example {
  realm_id                  = keycloak_realm.realm.id
  name                      = "example"
  description               = "Example OpenID Connect scope"
  include_in_token_scope    = false
  # the implicit way to set attribute: `display.on.consent.screen=true`
  consent_screen_text = "example"
}