Due to problem with duplicate sub in JWT, it is possible to use this js mapper. It is just a workaround solution and I do not recommend using it in a production environment.
https://issues.redhat.com/browse/KEYCLOAK-14309
To Create a JAR with the scripts to deploy check official documentation.