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:
import zi_api_auth_client
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:
import zi_api_auth_client
Paste your private key:
key = ‘’’
—–BEGIN PRIVATE KEY—–
Your private key goes here
—–END PRIVATE KEY—–‘’’
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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 352a0194b4f2bf87e42524f8cb0754ef2b0110937495dd728d9e76586d732666 |
|
MD5 | 36d8bc20cc111616f70b8b247d36dfb8 |
|
BLAKE2b-256 | ede4757b7dd2fe0fa141fcb0fd73b0976281eccf7eabbcc190fa82b8c587d233 |
File details
Details for the file zi_api_auth_client-2.0.2-py3-none-any.whl
.
File metadata
- Download URL: zi_api_auth_client-2.0.2-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8426ee7c68620dcbae3a809860da909acd93f9b793fa0a67116c6fd5424cd9cf |
|
MD5 | 4da96855184be3d2cced56f1fe3a1b4f |
|
BLAKE2b-256 | 9c23c53efb755d531c7b126fc65cda1eec2c39b3bc7fc408c956007b84f00e4b |