Skip to main content

Kognic Authentication

Reason this release was yanked:

Code missing, fixed in 3.0.2

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

3.0.0 (2022-09-26)

  • Rebranded from Annotell to Kognic.
  • Dropped deprecated FaultTolerantAuthRequestSession

2.0.0 (2022-05-02)

Refactor for backend separation, with optional dependencies for either httpx or requests.

1.8.0 (2022-04-12)

  • Initial support for httpx (BETA). Solves refresh token expiry by reset without the FaultTolerantAuthRequestSession
  • The library will be refactored by a breaking 2.0 release, and make the same changes to the requests version. The authsession module backed by requests is untouched for now.

1.7.0 (2022-04-11)

  • Fix compatibility issue with authlib >= 1.0.0. Resetting the auth session failed, when the refresh token had expired.

1.6.0 (2021-02-21)

  • Expose underlying requests.Session on FaultTolerantAuthRequestSession
  • Fix some thread locks

1.5.0 (2020-10-20)

  • Add FaultTolerantAuthRequestSession that handles token refresh on long running sessions.

1.4.0 (2020-04-16)

  • Add support for auth parameter, with path to credentials file or AnnotellCredentials object
  • Drop support for legacy API token

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

Uploaded Source

Built Distribution

kognic_auth-3.0.1-py2.py3-none-any.whl (7.8 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: kognic-auth-3.0.1.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for kognic-auth-3.0.1.tar.gz
Algorithm Hash digest
SHA256 583d2cc8757349003daab7a6739e188cfecb7388fce83a7f71b0cac6a5fe4def
MD5 f97421cb24c0ee74210e247c886c6e41
BLAKE2b-256 95730483a9c36e8921d91e446f580e192a7a80969436cb047f2c20d2327aab45

See more details on using hashes here.

File details

Details for the file kognic_auth-3.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for kognic_auth-3.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 12132fb317a1665f2a4629e80dc65a93aa57b00e36507b2fa18a176457598c27
MD5 5d2295f0a4ec161890ad30f83e2e46cc
BLAKE2b-256 9daa6a7594114cf0e54a3aeb5f94d7a26ab901a9b74c7a7310a35b357b5b285a

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