Skip to main content

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.

  1. Set the environment variable KOGNIC_CREDENTIALS to point to your Api Credentials file. The credentials will contain the Client Id and Client Secret.
  2. Set to the credentials file path like auth="~/.config/kognic/credentials.json"
  3. Set environment variables KOGNIC_CLIENT_ID andKOGNIC_CLIENT_SECRET
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kognic-auth-3.2.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kognic_auth-3.2.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file kognic-auth-3.2.0.tar.gz.

File metadata

  • Download URL: kognic-auth-3.2.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for kognic-auth-3.2.0.tar.gz
Algorithm Hash digest
SHA256 d293cddf511187f8b672610f94af1c9f6dbfba3563ab5b66a467244a698fd608
MD5 ca848518f5e717b6d86a91a2ad995862
BLAKE2b-256 7f3ad34e26c89014289a830bffb87c69926d9fd17dddcbc9aa0b4ea45091d188

See more details on using hashes here.

File details

Details for the file kognic_auth-3.2.0-py3-none-any.whl.

File metadata

  • Download URL: kognic_auth-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for kognic_auth-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5738b806f0c326542ad37da76be25f776bcf6e7ebe35b0d34d87512556800be1
MD5 d7d9e8947d0a678d85f23dc1fd37c126
BLAKE2b-256 28d87987b3ed4ebd79cb0af633d62e5fe60d566b58f7ec4e57b2854238a6616f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page