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

Uploaded Source

Built Distribution

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

zi_api_auth_client-2.0.3-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zi_api_auth_client-2.0.3.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for zi_api_auth_client-2.0.3.tar.gz
Algorithm Hash digest
SHA256 cd86d0bd3b6870478097f7de6f2b360f81ae94deb808f9c1c64bedd14431a441
MD5 5f351ed7d96d56c893532d7960efcc89
BLAKE2b-256 522fb72d362dccbf6d917d40104e0b41b03fbd7606c2636ec6a2baec42017b4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zi_api_auth_client-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7b0c2992df74976e890e36e15396c062aac83655b570b8745e2641dc56e6a2ab
MD5 46150135996135797560ab3e6ac0ca69
BLAKE2b-256 9d1b697693bc2f527d84f036c4cf76925ed7b982b0760bcd272951a1d2484e08

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