JupyterHub authentication token renewal ?

59 views
Skip to first unread message

oscar6echo

unread,
Jun 11, 2018, 11:35:16 AM6/11/18
to Project Jupyter
Hello,

Does JHub manages token renewal ? using refrresh tokens ?
I mean that after the initial authentication flow (OAuth2 authorization code), tokens usually expire.

Has anybody implemented a mechanism that enables a JHub user to request an access_token from the Hub: to renew it and/or to request for one with more scopes - with a view to tapping protected APIs ?

I will need to do it anyway but maybe some people have faced this issue before ?
If so I would be grateful for links or keywords.

Thx

Tim Head

unread,
Jun 11, 2018, 11:53:39 AM6/11/18
to jup...@googlegroups.com
I built a (very) simple token refresher service for openhumans.org:

it is a combination of https://github.com/OpenHumans/jhoauth-refresh (nbserver extension) and https://github.com/wildtreetech/ohjh/blob/master/images/refresher/whoami.py which is the corresponding JupyterHub service (based on the WhoAmiI example service).

The nbserver extension will periodically ask the service for a token, the service decides if it has a fresh token or if it first needs to refresh it, potentially refreshes it, updates the auth state held by the hub, returns a fresh token to the user.

Hope this gives you some ideas.

T

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/afa2fec3-2287-4b69-87fd-fb793daa190a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

oscar6echo

unread,
Jun 11, 2018, 2:50:15 PM6/11/18
to Project Jupyter
Oh yes it does ! Very relevant snippets !
Thank you very much !!

By the way I'll come shake hands at the PyData Paris 19jun where I saw you present.
Reply all
Reply to author
Forward
0 new messages