protected LdapUserDto getLdapUserByMemberAttr(String memberAttributeValue) {
    LdapServerProperties ldapServerProperties = getLdapProperties();
    Set<LdapUserDto> filteredLdapUsers;

    memberAttributeValue = getUniqueIdByMemberPattern(memberAttributeValue,
        ldapServerProperties.getSyncUserMemberReplacePattern());
    Filter syncMemberFilter = createCustomMemberFilter(memberAttributeValue,
        ldapServerProperties.getSyncUserMemberFilter());

    if (memberAttributeValue != null && syncMemberFilter != null) {
      LOG.trace("Use custom filter '{}' for getting member user with default baseDN ('{}')",
          syncMemberFilter.encode(), ldapServerProperties.getBaseDN());
      filteredLdapUsers = getFilteredLdapUsers(ldapServerProperties.getBaseDN(), syncMemberFilter);
    } else if (memberAttributeValue != null && isMemberAttributeBaseDn(memberAttributeValue)) {
      LOG.trace("Member can be used as baseDn: {}", memberAttributeValue);
      Filter filter = new EqualsFilter(OBJECT_CLASS_ATTRIBUTE, ldapServerProperties.getUserObjectClass());
      filteredLdapUsers = getFilteredLdapUsers(memberAttributeValue, filter);
    } else {
      LOG.trace("Member cannot be used as baseDn: {}", memberAttributeValue);
      Filter filter = new AndFilter()
          .and(new EqualsFilter(OBJECT_CLASS_ATTRIBUTE, ldapServerProperties.getUserObjectClass()))
          .and(new EqualsFilter(ldapServerProperties.getUsernameAttribute(), memberAttributeValue));
      filteredLdapUsers = getFilteredLdapUsers(ldapServerProperties.getBaseDN(), filter);
    }
    return (filteredLdapUsers.isEmpty()) ? null : filteredLdapUsers.iterator().next();
  }
Get the LDAP user member for the given member attribute.

@param memberAttributeValue the member attribute value
@return the user for the given member attribute; null if not found
ambari-server/src/main/java/org/apache/ambari/server/security/ldap/AmbariLdapDataPopulator.java