    def get_current_user(self):
        """The login handler stored a JupyterHub API token in a cookie

        @web.authenticated calls this method.
        If a Falsy value is returned, the request is redirected to `login_url`.
        If a Truthy value is returned, the request is allowed to proceed.
        """
        token = self.get_secure_cookie('whoami-oauth-token')

        if token:
            # secure cookies are bytes, decode to str
            return token.decode('ascii', 'replace')
The login handler stored a JupyterHub API token in a cookie

@web.authenticated calls this method.
If a Falsy value is returned, the request is redirected to `login_url`.
If a Truthy value is returned, the request is allowed to proceed.
examples/external-oauth/whoami-oauth-basic.py