def _ldap_bind(ldap, con, dn: str, password: str) -> bool:
        """
        Validates/binds the provided dn/password with the LDAP sever.
        """
        try:
            log.debug("LDAP bind TRY with username: '%s'", dn)
            con.simple_bind_s(dn, password)
            log.debug("LDAP bind SUCCESS with username: '%s'", dn)
            return True
        except ldap.INVALID_CREDENTIALS:
            return False

        Validates/binds the provided dn/password with the LDAP sever.
        
flask_appbuilder/security/manager.py