'Tornado\'s authentication method
Returns:
user_model (dict): The user model, if a user is identified, None if authentication fails.'

def get_current_user(self):

    if hasattr(self, '_hub_auth_user_cache'):
        return self._hub_auth_user_cache
    user_model = self.hub_auth.get_user(self)
    if (not user_model):
        self._hub_auth_user_cache = None
        return
    try:
        self._hub_auth_user_cache = self.check_hub_user(user_model)
    except UserNotAllowed as e:
        self._hub_auth_user_cache = None
        raise HTTPError(403, '{kind}    {name}    is    not    allowed.'.format(**e.model))
    except Exception:
        self._hub_auth_user_cache = None
        raise
    return self._hub_auth_user_cache
