mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-07 10:04:07 +00:00

- remove long-deprecated `POST /api/authorizations/token` for creating tokens - deprecate but do not remove `GET /api/authorizations/token/:token` in favor of GET /api/user - remove shared-cookie auth for services from HubAuth, rely on OAuth for browser-auth instead - use `/hub/api/user` to resolve user instead of `/authorizations/token` which is now deprecated
Authenticating a flask service with JupyterHub
Uses jupyterhub.services.HubOAuth
to authenticate requests with the Hub in a flask application.
Run
-
Launch JupyterHub and the
whoami service
withjupyterhub --ip=127.0.0.1
After logging in with your local-system credentials, you should see a JSON dump of your user info:
{
"admin": false,
"last_activity": "2016-05-27T14:05:18.016372",
"name": "queequeg",
"pending": null,
"server": "/user/queequeg"
}
This relies on the Hub starting the whoami service, via config (see jupyterhub_config.py).
A similar service could be run externally, by setting the JupyterHub service environment variables:
JUPYTERHUB_API_TOKEN
JUPYTERHUB_SERVICE_PREFIX