Hello,
I have the following scenario with the latest JupyterHub (4.1.5):
We created a JupyterHub service server manager that is based on JupyterHub Admin page. Essentially the service is a stripped down Admin page that lets our support team to access user’s servers when our users need help. The service renders the list of running servers using the React app like for the admin page (although lot of components from the original app are removed).
With the new reinforced auth flow, when users login into hub, there is a XSRF cookie set with path /hub/
. And when users access the service, a new XSRF cookie is set with path /service/server-manager/
, assuming server-manager
is the name of the service. Just like in the admin page, the React App is making API requests to hub to get list of servers, users, etc.
The problem comes here: the browser is sending the _xsrf
cookie for /hub/
as the requested API is /hub/api/users
but the service has a different _xsrf
token set and hence, we end up with following:
[W 2024-04-11 15:01:16.172 JupyterHub web:1873] 403 GET /hub/api/users?include_stopped_servers&offset=0&limit=10&name_filter=&_xsrf=[secret] (::ffff:127.0.0.1): XSRF cookie does not match GET argument
At least this what I understood. Please let me know if that is not the case.
My question is if it is possible to make API requests to hub from browser from within a service? Or is there a better way to solve this issue. It was working with the previous versions of JupyterHub which I guess due to usage of single _xsrf
token everywhere?!
Cheers!