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

Disabling "Review Profile" for "First Broker Login"

Open embody opened this issue 3 years ago • 1 comments

Hi! We've tried to disable the "Review Profile" Auth Type for the "First Broker Login" Authentication configuration, as here the user would have the possibility to specify information that is not issued by the underlying IdP. I've tried it with the keycloak_authentication_execution but just managed to get new flows or errors which where stating, that a built in flow can't be altered. Have I missed something here or is it at the moment not possible?

image

embody avatar Mar 26 '21 07:03 embody

Seems to relate to https://github.com/mrparkers/terraform-provider-keycloak/issues/296

cpesch avatar Mar 26 '21 12:03 cpesch

Whilst I'm a bit late to the party, I too had the same error, after much blood sweat, and tears looking at the exported JSON and working out what resource names matched up I came up with the following workaround.

It does not disable it, because as you said you can't change an existing option - but you can turn it off using the config behind

data "keycloak_authentication_flow" "first_broker_login" {
  realm_id = keycloak_realm.finocomp_realm.id
  alias = "first broker login"
}

data "keycloak_authentication_execution" "first_broker_login" {
  realm_id          = keycloak_realm.finocomp_realm.id
  parent_flow_alias = data.keycloak_authentication_flow.first_broker_login.alias
  provider_id       = "idp-review-profile"
}

resource "keycloak_authentication_execution_config" "first_broker_login" {
  realm_id     = keycloak_realm.finocomp_realm.id
  execution_id = data.keycloak_authentication_execution.first_broker_login.id
  alias        = "review profile config"
  config = {
     "update.profile.on.first.login" = "off"
   }
}

Marcus-James-Adams avatar Sep 28 '22 16:09 Marcus-James-Adams