def _search_ldap(self, ldap, con, username):
        filter_str = "%s=%s" % (self.auth_ldap_uid_field, username)
        user = con.search_s(self.auth_ldap_search,
                            ldap.SCOPE_SUBTREE,
                            filter_str,
                            [self.auth_ldap_firstname_field,
                             self.auth_ldap_lastname_field,
                             self.auth_ldap_email_field
                            ])
        if user:
            if not user[0][0]:
                return None
        return user
Searches LDAP for user, assumes ldap_search is set.
dataset/ETHPy150Open dpgaspar/Flask-AppBuilder/flask_appbuilder/security/manager.py/BaseSecurityManager._search_ldap