1. You need to provide a search filter that checks for the username against multiple LDAP attributes.
2. For example, if you have some users who login using their email and some using their username,
the following search filter can be applied: (&(objectClass=*)(|(mail=?)(cn=?)))