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
- Client credentials 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
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 oidcish-1.0.3.tar.gz.
File metadata
- Download URL: oidcish-1.0.3.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.10 Linux/5.10.102.1-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b415466199731da06c3cc043a67dfacc3d9221bdd87c8ed44a325f68757a49e6
|
|
| MD5 |
ea0dbd022135bd52ffbc614053ae534e
|
|
| BLAKE2b-256 |
88748b9813658d37a253bbf4df43aa02d37b7e821dff93720ddfdacee2d76cf3
|
File details
Details for the file oidcish-1.0.3-py3-none-any.whl.
File metadata
- Download URL: oidcish-1.0.3-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.10 Linux/5.10.102.1-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
382298035ef5ddfc5994ab0e49da074339cc57b39520fb8cf4ed99ddf1fe1dbe
|
|
| MD5 |
dd81efb86e41d113a97c19bea343d20b
|
|
| BLAKE2b-256 |
9cd0d380708bcc8b18a48d191c7fd0e7bd7b1bc1def67a385c35a7366cf5d6f2
|