    def user_for_token(self, token, use_cache=True, session_id='', *, sync=True):
        """Ask the Hub to identify the user for a given token.

        .. versionadded:: 2.4
            async support via `sync` argument.

        Args:
            token (str): the token
            use_cache (bool): Specify use_cache=False to skip cached cookie values (default: True)
            sync (bool): whether to block for the result or return an awaitable

        Returns:
            user_model (dict): The user model, if a user is identified, None if authentication fails.

            The 'name' field contains the user's name.
        """
        return self._call_coroutine(
            sync,
            self._check_hub_authorization,
            url=url_path_join(
                self.api_url,
                "user",
            ),
            api_token=token,
            cache_key='token:{}:{}'.format(
                session_id,
                hashlib.sha256(token.encode("utf8", "replace")).hexdigest(),
            ),
            use_cache=use_cache,
        )
Ask the Hub to identify the user for a given token.

.. versionadded:: 2.4
async support via `sync` argument.

Args:
token (str): the token
use_cache (bool): Specify use_cache=False to skip cached cookie values (default: True)
sync (bool): whether to block for the result or return an awaitable

Returns:
user_model (dict): The user model, if a user is identified, None if authentication fails.

The 'name' field contains the user's name.
jupyterhub/services/auth.py