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.5.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

kognic_auth-3.5.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file kognic_auth-3.5.0.tar.gz.

File metadata

  • Download URL: kognic_auth-3.5.0.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

Hashes for kognic_auth-3.5.0.tar.gz
Algorithm Hash digest
SHA256 8cc5c5af42a9022b618081c9c978dfe9656d1f5f114b49b31c84bf049c0dc901
MD5 f56f520392f786dc76701047aa680c4e
BLAKE2b-256 c843f2e8c2ed88d24fd19d280236757bca704d1ad3edc42cb838c5f85d2ed865

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kognic_auth-3.5.0-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

Hashes for kognic_auth-3.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b565f771debe363088a651ee8ae339b4d0fa047bbfe415c74768b0d48a464aa
MD5 e8e7fa0cefb8f964cb46949ce6117101
BLAKE2b-256 2dcfcf1f0f6c1ef2aac5c353f0203546bc92654c11f0c605cd2e84e23a9d20d1

See more details on using hashes here.

Supported by

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