How to create a Script Mapper in Keycloak?
问题 I need to create a Protocol Mapper of type Script Mapper in Keycloak. The script should get a user attribute, check its size, and put it on the token. I found no documentation or examples of how a script should be created. From the bits and pieces I could gather, I guess I the script would need to look something like: var value = user.getAttribute("myAttribute"); if (value.length > LIMIT) { value = value.substring(0,LIMIT); } token.setOtherClaims("myAttribute",value); Is this right? I made up