'Authenticate a user against the LDAP and local databases.
user_id is checked case insensitively against the local database, but
will throw if there are multiple inexact matches.
Args:
user_id (str): complete @user:id
Returns:
(str) the canonical_user_id
Raises:
LoginError if login fails'

@defer.inlineCallbacks
def _check_password(self, user_id, password):

    for provider in self.password_providers:
        is_valid = (yield provider.check_password(user_id, password))
        if is_valid:
            defer.returnValue(user_id)
    canonical_user_id = (yield self._check_local_password(user_id, password))
    if canonical_user_id:
        defer.returnValue(canonical_user_id)
    raise LoginError(403, 'Invalid    password', errcode=Codes.FORBIDDEN)
