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

Support for client profiles and policies #888

Open TBeijen opened 9 months ago

TBeijen commented 9 months 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 6 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'.