Skip to main content

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

swanoauthrenew-1.0.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

swanoauthrenew-1.0.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

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

Hashes for swanoauthrenew-1.0.2.tar.gz
Algorithm Hash digest
SHA256 26377710ebf68a9a7665e99aa5d8008d3c7eda860ad4c962ff76757722e5ee7b
MD5 b9859f7bb8733e37fb3df9d6f7f0dfd1
BLAKE2b-256 49f032040562f7d316f7d64166a0fc03d1838d6e7b42991879c75d2fdcc81c64

See more details on using hashes here.

File details

Details for the file swanoauthrenew-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for swanoauthrenew-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fcd1be619126b88e5226b5ad5bbe925fb3426d576e16412faae16f9480357475
MD5 3ef93d23398b85434815d3a0ff3dacd1
BLAKE2b-256 0fca468e8982232e0bbf99340cd9e3a4ba4432f6518a509014e0440cf689c376

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page