A python library for requesting OpenID Connect access tokens from oidc-agent.
Project description
liboidcagent
A python library for requesting OpenID Connect access tokens from oidc-agent.
Usage
import liboidcagent as agent
token, issuer, expires_at = agent.get_token_response("iam")
token, issuer, expires_at = agent.get_token_response("iam", 60)
tokenresponse = agent.get_token_response("iam", application_hint="Example-Py-App")
tokenresponse = agent.get_token_response("iam", 60, "Example-Py-App")
tokenresponse = agent.get_token_response("iam", 60, "Example-Py-App", "openid profile email")
tokenresponse = agent.get_token_response("iam", 60, "Example-Py-App", "openid profile email", "foo bar")
token = agent.get_access_token("iam", 60, "Example-Py-App")
token, issuer, expires_at = agent.get_token_response_by_issuer_url("https://issuer.example.com", 60, "Example-Py-App")
token = agent.get_access_token_by_issuer_url("https://issuer.example.com", 60, "Example-Py-App")
Error Handling
The library will raise an exception of type OidcAgentError if something goes
wrong.
Error Handling can be done the following way:
try:
print(agent.get_access_token(account_name))
except agent.OidcAgentError as e:
print("ERROR oidc-agent: {}".format(e))
Installation
pip install liboidcagent
License
liboidcagent is provided under the MIT License.
Project details
Release history Release notifications | RSS feed
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 liboidcagent-0.5.2.tar.gz.
File metadata
- Download URL: liboidcagent-0.5.2.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
279404c31ae0f509f200ab30bcfc8ddbbac6a555bcc0c7bee2da21fff109c9af
|
|
| MD5 |
e383a5d7b28c964ecdada245b147ba94
|
|
| BLAKE2b-256 |
daeb4ead00f23583b3ab14d2cda38fae1bca60510f8e36241c9353ed098d2284
|
File details
Details for the file liboidcagent-0.5.2-py3-none-any.whl.
File metadata
- Download URL: liboidcagent-0.5.2-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26b681989933a82531ecbb49ec14a90f96ebeab78acc7c205834109b532f0266
|
|
| MD5 |
647535d8c5593adf85c453fa9670db1a
|
|
| BLAKE2b-256 |
586ff5e39663204db7201c100f5bc6977c26509ad4995c79affff35dc266e9c7
|