Skip to main content

Obtain authentication tokens from OIDC providers.

Project description

oidcish

  • "Oh I Don't Care If Something Happens"
  • "OIDC Is Definitely Cool If Someone Helps"

What?

Library to connect to your OIDC provider via:

  • Authentication code flow
  • Device code flow

Usage

>>> from oidcish import DeviceFlow, CodeFlow, CredentialsFlow
>>> auth = DeviceFlow(
...     host="https://idp.example.com",
...     client_id=...,
...     client_secret=...,
...     scope=...,
...     audience=...
...)
Visit https://idp.example.com/device?userCode=594658190 to complete sign-in.
# Or use env file for auth
# auth = DeviceFlow(_env_file="path/to/my/env.file")
# Or use authorization code flow
# auth = CodeFlow(_env_file="path/to/my/env.file")
# Or use client credentials flow
# auth = CredentialsFlow(_env_file="path/to/my/env.file")
>>> print(auth.credentials.access_token)
eyJhbGciOiJSU...

Options

Device flow can be used with the following options:

Option Environment variable Default Description
host OIDCISH_HOST No default The address to the IDP server.
client_id OIDCISH_CLIENT_ID No default The client id.
client_secret OIDCISH_CLIENT_SECRET No default The client secret.
scope OIDCISH_SCOPE openid profile offline_access A space separated, case-sensitive list of scopes.
audience OIDCISH_AUDIENCE No default The access claim was designated for this audience.

The OIDCISH_ prefix can be set with the OIDCISH_ENV_PREFIX environment variable.

Code flow can be used with the following options:

Option Environment variable Default Description
host OIDCISH_HOST No default The address to the IDP server.
client_id OIDCISH_CLIENT_ID No default The client id.
client_secret OIDCISH_CLIENT_SECRET No default The client secret.
redirect_uri OIDCISH_REDIRECT_URI http://localhost Must exactly match one of the allowed redirect URIs for the client.
username OIDCISH_USERNAME No default The user name.
password OIDCISH_PASSWORD No default The user password.
scope OIDCISH_SCOPE openid profile offline_access A space separated, case-sensitive list of scopes.
audience OIDCISH_AUDIENCE No default The access claim was designated for this audience.

The OIDCISH_ prefix can be set with the OIDCISH_ENV_PREFIX environment variable.

Client credentials flow can be used with the following options:

Option Environment variable Default Description
host OIDCISH_HOST No default The address to the IDP server.
client_id OIDCISH_CLIENT_ID No default The client id.
client_secret OIDCISH_CLIENT_SECRET No default The client secret.
audience OIDCISH_AUDIENCE No default The access claim was designated for this audience.

The OIDCISH_ prefix can be set with the OIDCISH_ENV_PREFIX environment variable.

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

oidcish-0.3.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

oidcish-0.3.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file oidcish-0.3.0.tar.gz.

File metadata

  • Download URL: oidcish-0.3.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.6 Linux/5.10.102.1-microsoft-standard-WSL2

File hashes

Hashes for oidcish-0.3.0.tar.gz
Algorithm Hash digest
SHA256 74d561065ec9aa716dd29086a03b1faeaafb931ac0de693d3066269fd3f977e8
MD5 55b4eeb80d395d65febe086b0486ea6a
BLAKE2b-256 995fefdc82f4220622ce7a3732bc8a87f0aa90b773d7069a188d5386e301238d

See more details on using hashes here.

File details

Details for the file oidcish-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: oidcish-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.6 Linux/5.10.102.1-microsoft-standard-WSL2

File hashes

Hashes for oidcish-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 617bf0271315c5af92b5bdc696b5741092abb8ea8f39d6bca3be58c5119338aa
MD5 0411e558f0ee6c4283cc21604cf22f36
BLAKE2b-256 1011e1af742df580580e217994da097c284ead712276264bd8ab29136c5646eb

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