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

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

Open
lozytskyi-sergii opened this issue Aug 12, 2024 · 0 comments

Comments

@lozytskyi-sergii
Copy link

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:

  • Not require code as mandatory attribute.
  • Allow set type property to "script-<policy_js_script>.js" where <policy_js_script>.js is a policy script file inside JAR.

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.

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