-
Improvement
-
Resolution: Unresolved
-
Major
-
None
LDAP Email Plugin requires the search attribute must be formatted to 'attribute=value'.
I would like more options for selection of LDAP search attribute.
Example search attribute : (&(ID=%s)(cn=prefix*))
The 'LdapMailAddressResolver' requires one simple change to support this. Instead of "search attribute" being the attribute, it is an LDAP filter with %s entered for where userName is to be inserted.
private String performSearch(DirContext ctx, String userName) throws NamingException {
String emailAddress = null;
SearchControls controls = new SearchControls();
controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
//String filter = String.format("%s=%s", configuration.getSearchAttribute(), userName);
String filter = String.format(configuration.getSearchAttribute(), userName);