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
Hashes for kognic_auth-3.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0272e49edcc25c0b9396903cc33cf0dc6de3c608d25f5650f000d353fef03583 |
|
MD5 | 5444ce9c0b9df9bf6be191e5700297e8 |
|
BLAKE2b-256 | a06e71054f08249d0f9eef1cef2f655dbfccff1770a1de3a7cc874f3a89212fa |