Kognic Authentication
Project description
Kognic Authentication
Python 3 library providing foundations for Kognic Authentication
on top of the requests
or httpx
libraries.
Install with pip install kognic-auth[requests]
or pip install kognic-auth[httpx]
Builds on the standard OAuth 2.0 Client Credentials flow. There are a few ways to provide auth credentials to our api
clients. Kognic Python clients such as in kognic-io
accept an auth
parameter that
can be set explicitly or you can omit it and use environment variables.
There are a few ways to set your credentials in auth
.
- Set the environment variable
KOGNIC_CREDENTIALS
to point to your Api Credentials file. The credentials will contain the Client Id and Client Secret. - Set to the credentials file path like
auth="~/.config/kognic/credentials.json"
- Set environment variables
KOGNIC_CLIENT_ID
andKOGNIC_CLIENT_SECRET
- Set to credentials tuple
auth=(client_id, client_secret)
API clients such as the InputApiClient
accept this auth
parameter.
Under the hood, they commonly use the AuthSession class which is implements a requests
session with automatic token
refresh. An httpx
implementation is also available.
from kognic.auth.requests.auth_session import RequestsAuthSession
sess = RequestsAuthSession()
# make call to some Kognic service with your token. Use default requests
sess.get("https://api.app.kognic.com")
Changelog
See Github releases from v3.1.0, historic changelog is available in CHANGELOG.md
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
File details
Details for the file kognic_auth-3.5.1.tar.gz
.
File metadata
- Download URL: kognic_auth-3.5.1.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff8e8c9285467ae1ba8777dc62e98f32f7a9854504c7ff480c1ca40cb86f415a |
|
MD5 | d2727a267a322bd7b5720b9ea6438fcf |
|
BLAKE2b-256 | e48c8e531506864da88a4e9eaf9d4660861fcdcbe60e3d48551f6549b25ca9cb |
File details
Details for the file kognic_auth-3.5.1-py3-none-any.whl
.
File metadata
- Download URL: kognic_auth-3.5.1-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aca41756fd29520337fa736ce019076d5b09abd7616e213169b5163bb8295430 |
|
MD5 | 800d2ee14f6381ec48e91612ef98cdbc |
|
BLAKE2b-256 | ab3c5d2a9ace5fc966758e1b7dffc5f4e6d1a8a5fe0c39a2cb4a54a6f6c3bc3d |