Extension that renews an OAuth2 token
Project description
SwanOauthRenew
This is a server extension that fetches the oAuth tokens available in the "user" endpoint of the JupyterHub API (1) and stores them in files that can be accessed by other processes (like the EOS client). It can be configured to take any token from the auth state dictionary and write it with any content format.
(1) For now, this functionality is exclusive to SwanHub (our JH wrapper). It does not work on vanilla JH, as the auth state is only available to admins.
Requirements
- notebook
Install
pip install swanoauthrenew
Usage
Configure the server extension to load when the notebook server starts
jupyter serverextension enable --py --user swanoauthrenew
Then is necessary to configure (in the jupyter config file) the files that need to be written, from where the tokens are coming from and how the file content should look like. Like so:
c.SwanOauthRenew.files = [
('/tmp/swan_oauth.token', 'access_token', '{token}'),
('/tmp/cernbox_oauth.token', 'exchanged_tokens/cernbox-service', '{token}'),
('/tmp/eos_oauth.token', 'exchanged_tokens/eos-service', 'oauth2:{token}:auth.cern.ch')
]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swanoauthrenew-1.0.2.tar.gz.
File metadata
- Download URL: swanoauthrenew-1.0.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26377710ebf68a9a7665e99aa5d8008d3c7eda860ad4c962ff76757722e5ee7b
|
|
| MD5 |
b9859f7bb8733e37fb3df9d6f7f0dfd1
|
|
| BLAKE2b-256 |
49f032040562f7d316f7d64166a0fc03d1838d6e7b42991879c75d2fdcc81c64
|
File details
Details for the file swanoauthrenew-1.0.2-py3-none-any.whl.
File metadata
- Download URL: swanoauthrenew-1.0.2-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcd1be619126b88e5226b5ad5bbe925fb3426d576e16412faae16f9480357475
|
|
| MD5 |
3ef93d23398b85434815d3a0ff3dacd1
|
|
| BLAKE2b-256 |
0fca468e8982232e0bbf99340cd9e3a4ba4432f6518a509014e0440cf689c376
|