swan-cern / jupyterhub-extensions

Customized components of the Jupyterhub server in SWAN (handlers, spawners, templates).
GNU Affero General Public License v3.0
26 stars 14 forks source link

Authenticator updates #15

Closed diocas closed 4 years ago

diocas commented 4 years ago

Changes in this PR related to the authenticator:

Closes #13 Closes #11

diocas commented 4 years ago

@ricastell This means that the first part of the token update is done. Now you will have a token set as env variable, so in the session startup script you will need to save it to the corresponding file so that EOS already works.

Then, inside the container, you need to create a server extension that, from time to time, polls the user information from JH and updates the token file (I would say 1min before the token expires). The following call (inside the user container) will always return a JSON with a valid access token (unless the session expired):

curl -H "Authorization: token $JUPYTERHUB_API_TOKEN" $JPY_HUB_API_URL/users/$USER