keycloak / terraform-provider-keycloak

Terraform provider for Keycloak
https://registry.terraform.io/providers/mrparkers/keycloak/latest/docs
Apache License 2.0
648 stars 317 forks source link

Support for client profiles and policies #888

Open TBeijen opened 1 year ago

TBeijen commented 1 year ago

It looks like the provider does not support 'client profiles' and 'client policies', as can be found under realm settings.

Relevant parts of REST API:

JSON fragment from export realm:

  "clientPolicies": {
    "policies": [
      {
        "name": "Client secret rotation",
        "enabled": true,
        "conditions": [
          {
            "condition": "client-roles",
            "configuration": {
              "is-negative-logic": "true",
              "roles": [
                "no-rotation"
              ]
            }
          }
        ],
        "profiles": [
          "Client secret rotation"
        ]
      }
    ]
  }
image
TBeijen commented 11 months ago

We found out the current provider actively removes any profile and policy that might exist.

Even though the fields are 'optional', as stated in the RealmRepresentation, and dedicated endpoints exist (see OP), including the profile and policy seems mandatory.

So the impact of this issue changes from 'not implemented by provider' to 'cannot use client profiles and policies'.