Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client Fine Grained permissions 'extra_config' only sometimes works. KC 24.0.5 #979

Open
bradhead opened this issue Jul 9, 2024 · 0 comments

Comments

@bradhead
Copy link

bradhead commented Jul 9, 2024

I was trying to add a client token exchange policy, and it would fail. I discovered I need to set the extra config:

  resource "keycloak_openid_client " "client_pas_rs" {
   ...
   service_accounts_enabled     = true

    extra_config = {
      "authorizationServicesEnabled" = true
      "fineGrainAuthorizationEnabled" = true
    }
  }

When I did then performed an apply the policy resource applied correctly and all good. Token exchange client poilcy setup correct.

then I tore down and rebuilt from scratch, and this time the extra configuration had no effect and the policy resource failed. I have to manually toggle the fine grained permissions then re-run the terraform.

Here's the policy that fails when the above toggle is not applied. Note that I have a depends_on set for this.>

resource "keycloak_openid_client_client_policy" "pas_client_policy" {
  realm_id           = data.keycloak_realm.realm.id
  resource_server_id = data.keycloak_openid_client.realm_management.id
  name               = "token-exchange-policy"
  logic              = "POSITIVE"
  decision_strategy  = "UNANIMOUS"
  clients = [
    keycloak_openid_client.client_pas_mulesoft.id
  ]
  depends_on = [keycloak_openid_client.client_pas_rs, keycloak_openid_client.client_pas_mulesoft ]
}

Not sure why it is so inconsistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant