LDAP create email based on two ldap attributes


I’m running keycloak with a User Federation (LDAP/AD). Unfortunately on the AD side we don’t have a users e-mail attribute. Now we need the users e-mail to use OAuth2 / OpenID on the keycloak side. My plan is to generate the e-mail basend on the first and last name of an imported user.

I’m not really sure what’s the right way to achieve this. Should i use a Script Mapper? Or should i write a custom LDAP Mapper like FullNameLDAPStorageMapper? (keycloak/FullNameLDAPStorageMapper.java at cd342ad5714f15db1cc8b0cd55b788e6543c6dc8 · keycloak/keycloak · GitHub) ?

I already tried to search within in the docu, but i can’t find the right way to do this. .Sorry for the dump question but i’m completly new the keycloak.