Get request cookies from within notebook container?

Hi Everyone,

I’m running Jupyterhub in Docker Swarm.

I have some external authentication information in the user’s cookies that I’d like to access from within the Jupyter notebook. Right now I’m reading these cookies in the hub authenticator when they spawn their notebook and passing that into their docker container. But the authentication token can change while their notebook is open. Their cookies are updated, but I don’t have a way of updating that information from within the container, all I can do is restart their container so that it goes through the pre spawn hooks again.

Is there a way to access the user’s cookies from within their docker container so that I can update this information periodically? Or can I get the cookies periodically from the hub or configurable-http-proxy when they access the notebook?

I’m running jupyterhub1.2 / postgresql / configurable-http-proxy / singleuser1.2 docker images.


I don’t know of a way to do this at the moment.

There’s an open feature request to make the auth_state visible to users: auth state visible to self · Issue #3189 · jupyterhub/jupyterhub · GitHub

Thanks, I’ll check out some of the workarounds there and see if I can implement then.