-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renew of oAuth tokens inside the user session #27
Comments
@ricastell everything is in place except this This is what I've done inside the jupyter startup script to create the file: if [[ ! -z "$ACCESS_TOKEN" ]];
then
log_info "Storing oAuth token for EOS"
export OAUTH2_FILE=/tmp/eos_oauth.token
export OAUTH2_TOKEN="FILE:$OAUTH2_FILE"
echo -n oauth2:$ACCESS_TOKEN:$OAUTH_INSPECTION_ENDPOINT >& $OAUTH2_FILE
chown -R $USER:$USER $OAUTH2_FILE
chmod 600 $OAUTH2_FILE
fi What I suggest: the extension checks if To get the latest token, do the following (in Python, ofc): $ curl -H "Authorization: token $JUPYTERHUB_API_TOKEN" $JUPYTERHUB_API_URL/users/$NB_USER The reply contains the latest token ( {
"kind": "user",
"name": "username",
"admin": true,
"groups": [],
"server": "/user/username/",
"pending": null,
"created": "2020-08-31T09:31:24.638244Z",
"last_activity": "2020-08-31T10:43:46.033379Z",
"servers": {
"": {
(...)
}
},
"auth_state": {
"access_token": "blablabla",
"refresh_token": "blablabla",
"oauth_user": {
"sub": "username",
"cern_uid": 00000,
"preferred_username": "username",
"cern_gid": 00000,
"given_name": "Diogo",
"cern_preferred_language": "EN",
"home_institute": "CERN",
"cern_person_id": 821079,
"name": "Diogo Castro",
"cern_mail_upn": "[email protected]",
"family_name": "Castro",
"email": "[email protected]",
"cern_upn": "username"
},
"scope": [
"oidc-cern-profile",
"oidc-email",
"oidc-cern-login-info",
"oidc-client-id"
]
}
} |
We need to support oAuth token for accessing EOS and, in the future, to access the CS3APIs #26.
The token can, and will, be pushed while Spawning, but we also need to ensure that is renewed inside the user session. We should be able able to retrieve that information directly from the authenticator renewal process.
The best way to retrieve this information is to try to get the user auth_state directly from the JH API. If this information is not available, we create a Authenticated Service that will return this information.
The text was updated successfully, but these errors were encountered: