Deploy a Javascript Policy in Keycloak 10

I’ve followed the Create a JAR with the scripts to deploy instruction to create a custom Javascript policy for checking user attributes and it seems to be deployed successfully, however, I can’t see the policy name in the create policy dropdown . Is there any setting I need to enable for this feature?

After uploading the .jar file to /keycloak/standalone/deployments , it says WFLYSRV0010: Deployed "script.jar" (runtime-name : "script.jar") without any error. I can also see the {filename}.jar.deployed next to my script file.

Setup: I use docker-compose to launch a jboss/keycloak version 10.0.1 container. Here’s my docker-compose file:

version: "3.1"
        image: jboss/keycloak
        restart: always
            - 8080:8080
            KEYCLOAK_PASSWORD: admin
            KEYCLOAK_USER: admin
            - ./deployments:/opt/jboss/keycloak/standalone/deployments


    "policies": [
            "name": "my-policy",
            "fileName": "my-script-policy.js",
            "description": "My Policy from a JS file"


var context = $evaluation.getContext();
var contextAttributes = context.getAttributes();

if (contextAttributes.containsValue('', '')) {

Client policy setting

Thank you in advance for any suggestions.

@behrooz-tahanzadeh I am encountering the same issue as you described. Did you get this solve eventually ?

Unfortunately not, but we end up using the built in ones and they’re sufficient for us.
TBH I’m glad we didn’t use this feature :smiley: