# Keycloak-operator + custom mapper plugin

**URL:** <https://forum.keycloak.org/t/keycloak-operator-custom-mapper-plugin/10666>\
**Category:** Getting advice\
**Created:** [August 25, 2021, 12:42am UTC](https://forum.keycloak.org/t/keycloak-operator-custom-mapper-plugin/10666 "2021-08-25T00:42:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kfox1111](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/kfox1111/32/3744_2.png) [@kfox1111](https://forum.keycloak.org/u/kfox1111)\
**Post date:** [August 25, 2021, 12:42am UTC](https://forum.keycloak.org/t/keycloak-operator-custom-mapper-plugin/10666/1 "2021-08-25T00:42:05Z")

</div>

I created a mapper plugin as described by: [Server Developer Guide](https://www.keycloak.org/docs/latest/server_development/#create-a-jar-with-the-scripts-to-deploy)

Loaded the jar via:  
kind: Keycloak  
extensions:  
- [http://xxx/yyy/myplugin.jar](http://xxx/yyy/myplugin.jar)

I see a string saying its loading the module on the console.

But it doesn’t show up in the list of available mappers. Is there some other flag I need? if so, how do I specify it in the Keycloak object?

---

<div class="post-metadata">

**Author:** ![kfox1111](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/kfox1111/32/3744_2.png) [@kfox1111](https://forum.keycloak.org/u/kfox1111)\
**Post date:** [August 25, 2021, 7:18pm UTC](https://forum.keycloak.org/t/keycloak-operator-custom-mapper-plugin/10666/2 "2021-08-25T19:18:42Z")

</div>

I managed to get it to work. it wouldn’t load when I added:

```auto
  keycloakDeploymentSpec:
    experimental:
      command:
      - /opt/jboss/tools/docker-entrypoint.sh
      args:
      - -b0.0.0.0
      - -Dkeycloak.profile.feature.scripts=enabled 

But did show up when I added an additional line:
      - -Dkeycloak.profile.feature.upload_scripts=enabled 

Feels like somethings broken in 15.0.2 that upload_scripts must be enabled to get script jars to work.
```

---

<div class="post-metadata">

**Author:** ![kfox1111](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/kfox1111/32/3744_2.png) [@kfox1111](https://forum.keycloak.org/u/kfox1111)\
**Post date:** [August 25, 2021, 8:15pm UTC](https://forum.keycloak.org/t/keycloak-operator-custom-mapper-plugin/10666/3 "2021-08-25T20:15:14Z")

</div>

And to load it, in the KeycloakClient:

> ```
> protocolMappers:
> - name: custom
> id: dd2cd59e-c34e-4450-9c4f-4afe4d249fc0
> protocol: openid-connect
> protocolMapper: "script-my-script-mapper.js"
> consentRequired: false
> config:
> "id.token.claim": "true"
> "access.token.claim": "true"
> "userinfo.token.claim": "true"
> "jsonType.label": String
> "claim.name": wark
> 
> ```
