0

i couldn't find a solution in the keycloak docu or with the search function. I have a keycloak server with imported useres from ldap. unfortunately they don't have a value for the email field. Now i try to generate a custom user attribute where i concatenate the imported first and lastname to generate the users email address

like:

Attribute: mail-address      
Value: {firstname}.{lastname}@xyz.de

Is there any special syntax in Keycloak to do that or do I have to use the admin-api (REST API)?

Senua
  • 65
  • 5
  • 2
    You can create a custom mapper. The class you should look for is `AbstractLDAPStorageMapperFactory`. https://github.com/keycloak/keycloak/blob/cd342ad5714f15db1cc8b0cd55b788e6543c6dc8/federation/ldap/src/main/java/org/keycloak/storage/ldap/mappers/AbstractLDAPStorageMapperFactory.java – Ghokun Jul 02 '21 at 07:08
  • Alright. So i have to create a new maven project and create my own custom mapper and extend AbstractLDAPStorageMapper like the FullNameLDAPStorageMapper for example? – Senua Jul 02 '21 at 15:28
  • Yes. Deploy this extension to keycloak and use your new custom mapper. – Ghokun Jul 03 '21 at 07:06

0 Answers0