Skip to main content

A library that supports username-password and PKI authentication methods for enterprise-api

Project description

zi_api_auth_client

This library supports 2 types of authentication methods. Both the methods return a JWT token which you can use to make api calls for enterprise-api on production.

Username and password authentication:

Usage:

  1. import zi_api_auth_client

  2. jwt_token = zi_api_auth_client.user_name_pwd_authentication(“your_user_name”, “your_password”)

PKI authentication:

This type of authentication needs a private key and a client ID to generate the JWT token.

Usage:

  1. import zi_api_auth_client

  2. Paste your private key:

    key = ‘’’

    —–BEGIN PRIVATE KEY—–

    Your private key goes here

    —–END PRIVATE KEY—–‘’’

  3. jwt_token = zi_api_auth_client.pki_authentication(“your_user_name”, “your_client_id”, key)

Note: If you get the error “ValueError: Could not deserialize key data.” when doing PKI authentication, make sure that your private key is properly formatted. Paste the private key as a multi-line string in python.

Correct way:

The following is the right way to paste your private key.

‘’’

—–BEGIN PRIVATE KEY—–

Your private key goes here

—–END PRIVATE KEY—–‘’’

Wrong way:

Pasting the private key as follows would throw the error “ValueError: Could not deserialize key data.” because there are extra spaces on each line in the key.

‘’’

—–BEGIN PRIVATE KEY—–

Your private key goes here

—–END PRIVATE KEY—–‘’’

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

zi_api_auth_client-1.0.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

zi_api_auth_client-1.0.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file zi_api_auth_client-1.0.1.tar.gz.

File metadata

  • Download URL: zi_api_auth_client-1.0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for zi_api_auth_client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c525132fc4c2dda46348c432032e10740830723ce354077c191e796bd7f929fb
MD5 5f6bc09f19e1f2662142965ad84305ec
BLAKE2b-256 7108d657b06fed7074e9daf3d4719025dbc516eac599401f47ffe4a74b74c789

See more details on using hashes here.

File details

Details for the file zi_api_auth_client-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: zi_api_auth_client-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for zi_api_auth_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 63ad44659c091f78c1554dd219924e0ed0dc913e075eb1a9ecc0d2974f1ff2ec
MD5 ef05ca7dc497f3ff6c5e0e332dbcdf93
BLAKE2b-256 6b954ce93cecf98e92a6373cdcaebe3bff805c25efc1e033b5abc33dfe29b14f

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