keycloak / terraform-provider-keycloak

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

keycloak_openid_client_js_policy does not support policies uploaded via JAR files. #992

Open lozytskyi-sergii opened 3 months ago

lozytskyi-sergii commented 3 months ago

In the Keycloak 18 upload-script feature had been removed and there is no possibility anymore to upload JS code using keycloak_openid_client_js_policy.code property.

According to the latest documentation all JS authorization policies have to be uploaded via JAR files only.

Please adapt keycloak_openid_client_js_policy to:

Example how to create policy via Keycloak API : curl -X POST '<keycloak_host>/auth/admin/realms/<realm_id>/clients/<clinet_id_uuid>/authz/resource-server/policy/js' \ -H 'Authorization: Bearer <JWT>' \ -H 'Content-Type: application/json' \ -d '{ "name": "JS Policy Example", "type": "script-task-service-access-policy.js", "logic": "POSITIVE", "decisionStrategy": "AFFIRMATIVE" }' task-service-access-policy.js - is a policy script packed into JAR according to documentation.