[keycloak-user] How do I set a field for idToken when implementing custom Provider / Authenticator?

Dominik Guhr pinguwien at gmail.com
Wed Mar 7 05:03:31 EST 2018


Hi all,

so I create3d a custom Provider for my legacy db and a custom 
authenticator due to special requirements.

Now when I debug in validatePassword in 
AbstractUsernameFormAuthenticator.java, I get the user entity with all 
the fields I need.

Now my conrecete question is: How do I map these fields to the idtoken 
to use them in my application?

I tried adding a User Attribute Mapper to my client directly, but this 
gives me a nullpointerexception.
Also, in Admin Interface, the Field "Mappers" is missing from my custom 
Provider. Perhaps this is the fault? Did I forget to implement one 
thing? I used the storage-jpa example.

Any hints would be highly appreciated. If some code is needed, just ask :-)

Best regards,
Dominik


More information about the keycloak-user mailing list