    def check_allowed(self, username, authentication=None):
        """Check if a username is allowed to authenticate based on configuration

        Return True if username is allowed, False otherwise.

        No allowed_users set means any username is allowed.

        Names are normalized *before* being checked against the allowed set.

        .. versionchanged:: 1.0
            Signature updated to accept authentication data and any future changes

        .. versionchanged:: 1.2
            Renamed check_whitelist to check_allowed

        Args:
            username (str):
                The normalized username
            authentication (dict):
                The authentication model, as returned by `.authenticate()`.
        Returns:
            allowed (bool):
                Whether the user is allowed
        Raises:
            web.HTTPError(403):
                Raising HTTPErrors directly allows customizing the message shown to the user.
        """
        if self.allow_all:
            return True
        return username in self.allowed_users
Check if a username is allowed to authenticate based on configuration

Return True if username is allowed, False otherwise.

No allowed_users set means any username is allowed.

Names are normalized *before* being checked against the allowed set.

.. versionchanged:: 1.0
Signature updated to accept authentication data and any future changes

.. versionchanged:: 1.2
Renamed check_whitelist to check_allowed

Args:
username (str):
The normalized username
authentication (dict):
The authentication model, as returned by `.authenticate()`.
Returns:
allowed (bool):
Whether the user is allowed
Raises:
web.HTTPError(403):
Raising HTTPErrors directly allows customizing the message shown to the user.
jupyterhub/auth.py