'Authenticate a user against the specified LDAP server.
In order to prevent an unintended \'unauthenticated authentication\',
which is an anonymous bind with a valid dn and a blank password,
check for empty passwords explicitely (:rfc:`4513#section-6.3.1`)
:param dict conf: LDAP configuration
:param login: username
:param password: Password for the LDAP user
:return: LDAP entry of authenticated user or False
:rtype: dictionary of attributes'

def authenticate(self, conf, login, password):

    if (not password):
        return False
    entry = False
    try:
        filter = filter_format(conf['ldap_filter'], (login,))
    except TypeError:
        _logger.warning("Could    not    format    LDAP    filter.    Your    filter    should    contain    one    '%s'.")
        return False
    try:
        results = self.query(conf, tools.ustr(filter))
        results = [i for i in results if i[0]]
        if (len(results) == 1):
            dn = results[0][0]
            conn = self.connect(conf)
            conn.simple_bind_s(dn, password.encode('utf-8'))
            conn.unbind()
            entry = results[0]
    except ldap.INVALID_CREDENTIALS:
        return False
    except ldap.LDAPError as e:
        _logger.error('An    LDAP    exception    occurred:    %s', e)
    return entry
