Hello, I’m currently trying to integrate Jupyterhub into our main platform. We have a JWT token that is stored in a cookie on our top-level domain. Since JupyterHub is hosted as a sub-domain of our main app, it should have access to this cookie. I’m currently trying to read the value of this cookie in the ‘refresh_user’ method of our custom Authenticator class in order ensure that the current user’s session is still valid. How would I retrieve the value for this cookie? Here is my current pseudocode
def is_valid_token(token):
# do an API call to main app to validate token
is_valid = api_request(token)
return is_valid
async def refresh_user(self, user, handler, force=True):
token = # how to read the value from cookie named 'sessionToken' here?
if not self.is_valid_token(token):
handler.clear_cookie("jupyterhub-hub-login")
handler.clear_cookie("jupyterhub-session-id")
return False
return True