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
liboidcagent-0.4.0.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for liboidcagent-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc54fcd6cfb0a11380abdad8e000792d59c2951bfcbe68a7a47839a1003c5cde |
|
MD5 | 1b62f494de40767b74adf6cbb953e341 |
|
BLAKE2b-256 | 21b997b2eb28768aec5ee6bc447ea26f21524626c5d8a55819fab38e00e9077d |