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.4.0.tar.gz
.
File metadata
- Download URL: kognic_auth-3.4.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92ded14d7c11fa481e1ed8aee8fb6646f11a9968787f8087c20123f851ef37fa |
|
MD5 | 6a02b9fda132fb607bca441e24d2c77f |
|
BLAKE2b-256 | 3a7523a2d8203d3a0905e6ecbfa28fb6a8538fd299f8c60eb5fb00d9faf94425 |
File details
Details for the file kognic_auth-3.4.0-py3-none-any.whl
.
File metadata
- Download URL: kognic_auth-3.4.0-py3-none-any.whl
- Upload date:
- Size: 7.1 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 | c1cccba1588c4bbb35ad12a02e45fea201c7f0df94963ec4ddae18c7f4e9cf03 |
|
MD5 | 48067df452c0b4000edfcb8f01d21040 |
|
BLAKE2b-256 | 0929d920229fdadc5ca1dc59a84f921e920720ec4215ef9b6363fc7beb856e49 |