Ldap user email is null in my code

Hi at all,
I have a SpringBoot Application which starts a Camunda BPMN. I get my user data from ldap.
This is working all fine.
However when I query for one user:

User user = identityService.createUserQuery().userId(“exampleUserId”)).singleResult();

I get the right user, but the email is null. However in the phpLDAPadmin the user has an email adress.
Do I have to tell somewhere in the SpringBootLdapConfig, that the emails should be taken from LDAP to?
Or do I have to configure something in the phpLDAPadmin?

Thanks for your help :slight_smile:
Marvin

Hard to say for sure without seeing your ldap plugin configuration, but it sounds like the fields aren’t being mapped properly. Double check that you’re setting userEmailAttribute in your spring ldap config… it should match the attribute configured in ldap.

1 Like

Thanks a lot, that is the solution :slight_smile:

I just added:

plugin.setUserEmailAttribute(“mail”);

in my LDAP config and it worked.