[keycloak-dev] Script based OIDC Protocol Mapper

Thomas Darimont thomas.darimont at googlemail.com
Fri Sep 22 15:46:20 EDT 2017


Hi,

it has been a while since I proposed this feature [0],
but I finally managed to get this done [1].

I needed this to be able to dynamically compute
a token claim based on user attributes with a
javascript expression.

When "Script Mapper" is selected in the "Create New Mapper" dialog,
then the following script is used as a default value:

/**
* Available variables:
* user - the current user
* realm - the current realm
* token - the current token
* userSession - the current userSession
*/


//insert your code here...

[0] https://issues.jboss.org/browse/KEYCLOAK-3599
[1] https://github.com/keycloak/keycloak/pull/4495

Cheers,
Thomas


More information about the keycloak-dev mailing list