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

Uploaded Source

Built Distribution

zi_api_auth_client-2.0.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zi_api_auth_client-2.0.2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for zi_api_auth_client-2.0.2.tar.gz
Algorithm Hash digest
SHA256 352a0194b4f2bf87e42524f8cb0754ef2b0110937495dd728d9e76586d732666
MD5 36d8bc20cc111616f70b8b247d36dfb8
BLAKE2b-256 ede4757b7dd2fe0fa141fcb0fd73b0976281eccf7eabbcc190fa82b8c587d233

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zi_api_auth_client-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8426ee7c68620dcbae3a809860da909acd93f9b793fa0a67116c6fd5424cd9cf
MD5 4da96855184be3d2cced56f1fe3a1b4f
BLAKE2b-256 9c23c53efb755d531c7b126fc65cda1eec2c39b3bc7fc408c956007b84f00e4b

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