Skip to main content

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.

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.6.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

liboidcagent-0.6.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file liboidcagent-0.6.0.tar.gz.

File metadata

  • Download URL: liboidcagent-0.6.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for liboidcagent-0.6.0.tar.gz
Algorithm Hash digest
SHA256 4eacb1cbbc9e23ea7869f2443a121669ff531b5d679867a1174a23a994a62967
MD5 5155fddf3b1df41510ae11a5b0fa1858
BLAKE2b-256 4892a7c300cb23460e985c55d39187f8458452c89f06a46d888585305df5fdaa

See more details on using hashes here.

File details

Details for the file liboidcagent-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for liboidcagent-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52e1ff2e6283f814d5276f3d134f2e3c23a43d2751c17a01b3adf4ad6c41c97b
MD5 ed1c01aa97bf5d8a37774f3eb278490c
BLAKE2b-256 5ed79aca4a864839fe177e025f94c13f86f4a03d06340c7ab20cb8679a5d18fc

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