requests-scitokens¶
requests-scitokens provides an authentication plugin for
Requests that handles attaching
SciTokens to HTTP requests.
Installation¶
conda install -c conda-forge requests-scitokens
apt-get install python3-requests-scitokens
See the IGWN Computing Guide software repositories entry for Debian for instructions on how to configure the required IGWN Debian repositories.
dnf install python3-requests-scitokens
See the IGWN Computing Guide software repositories entries for Rocky Linux 8 or Rocky Linux 9 for instructions on how to configure the required IGWN RPM repositories.
python -m pip install requests-scitokens
requests-scitokens documentation¶
SciToken plugin for Requests.
Overview¶
This package provides a custom HTTPSciTokenAuth object that will handle
discovering a SciToken and attaching a serialisation of the token
to a request in the Authorization header.
The HTTPSciTokenAuth object will also dynamically handle 401 Unauthorized
response that include a WWW-Authenticate header with a Bearer challenge.
requests_scitokens includes wrapped versions of the standard requests.api
methods to simplify performing token-aware requests, for example:
>>> from requests_scitokens import get
>>> get('https://secure.example.com/')
To explicitly pass a SciToken into a request, use the token
keyword:
>>> import scitokens
>>> token = scitokens.SciToken.deserialize(...)
>>> get("https://secure.example.com", token=token)
Classes¶
|
Auth handler for SciTokens. |
|
|
|
|
Class Inheritance Diagram¶
