Repository navigation
Unable to deploy JS Based policy in Keycloak version 26.0.3 and above #43753
Unanswered
VamsiAdapaGit
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Issue Description
When deploying a custom JavaScript-based authorization policy as a JAR file into the /opt/keycloak/providers directory of a containerized Keycloak instance (version 26.0.3), the policy fails to register and is not available in the Admin UI. This process is being followed according to the official documentation for deploying scripts.
The provider JAR seems to be loaded by Keycloak at startup, but the JavaScript policy within it is never deployed, and no clear error message is logged.
Environment
Keycloak Version: 26.0.3
Keycloak Distribution: quay.io/keycloak/keycloak:26.0.3
Deployment Environment: Docker
Expected Behavior
The Keycloak startup logs should indicate that the policy.jar provider has been detected and the script has been deployed. When creating a new authorization policy in the Admin UI, the custom policy should appear as an option in the dropdown list.
Actual Behavior
The Keycloak logs do not show any error related to the provider JAR, but they also lack any confirmation that the policy.js script was deployed.
The custom policy is missing from the policy type dropdown in the Admin UI, making it impossible to select and use the script. The script is effectively ignored.
policy.js is attached here, and docker compose file is as below. Any assistance to correct and help in right direction, is appreciated.
Docker Compose
All reactions