Keycloak 9.0.2 : missing script mapper

Viewed 1991

with keycloak 9.0.2, we have to use a script mapper in a client to add specific claims from header request, but script mapper is missing in mapper type.

Here an extract of our docker-compose file :

version: '3.4'

services:

  keycloak:
    image: jboss/keycloak:latest
    command:
      - "-b 0.0.0.0"
      - "-Djboss.socket.binding.port-offset=1000"
      - "-Dkeycloak.profile.feature.scripts=enabled"
    env_file:
      - ./keycloak.env
    ports:
      - 9080:9080
      - 9443:9443
      - 10990:10990

In logs, we see the line at startup :

09:31:55,437 INFO [org.keycloak.common.Profile] (ServerService Thread Pool -- 69) Preview feature enabled: scripts

But when we create a new client and add mapper, in mapper type we dont't see Script mapper. We have try with standalone version without docker, and we get same problem.

What are we wrong ?

Thanks.

2 Answers

Try to enable also upload_scripts feature:

-Dkeycloak.profile.feature.upload_scripts=enabled

Here is the values.yaml of k8s for enabling upload_scripts

extraEnvVars:
  - name: KEYCLOAK_LOGLEVEL
    value: DEBUG
  - name: WILDFLY_LOGLEVEL
    value: DEBUG
  - name: KEYCLOAK_PROXY_ADDRESS_FORWARDING
    value: "true"
  - name: JAVA_OPTS
    value: "-Dkeycloak.profile.feature.scripts=enabled -Dkeycloak.profile.feature.upload_scripts=enabled -Dkeycloak.profile.feature.token_exchange=enabled -Dkeycloak.adminUrl=https://<iam URL>/auth/ -Dkeycloak.frontendUrl=https://<iam URL>/auth/ -Dnashorn.args=--no-deprecation-warning"

Related