'Authenticate a user and, if successful, return their username.
@type c: L{IUsernamePassword <credentials.IUsernamePassword>} or
L{IUsernameHashedPassword <credentials.IUsernameHashedPassword>}
provider.
@param c: Credentials.
@rtype: L{bytes}
@return: A string which identifies an user.
@raise UnauthorizedLogin: When the credentials check fails.'

def requestAvatarId(self, c):

    if (c.username in self.dirdbm):
        if c.checkPassword(self.dirdbm[c.username]):
            return c.username
    raise UnauthorizedLogin()
