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.0.tar.gz
.
File metadata
- Download URL: zi_api_auth_client-2.0.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cafa4317217e00f3fcc0b6b0e947b596dbd3e3dcf758627cb8105e7ab8c34ef |
|
MD5 | c063bb89b86f359a1eba534210345843 |
|
BLAKE2b-256 | 89671916e952d58cca4a957ecb2e2929689bde2db7267f5ab6cdfa7ef72624c9 |
File details
Details for the file zi_api_auth_client-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: zi_api_auth_client-2.0.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9c42d95f6915d98664a234f268d930cba752aadd5873cbbc4ff37bcb6394cab |
|
MD5 | c68637d401a4e4a37f2a52f3d618412a |
|
BLAKE2b-256 | bb95dca87203a263bba4dd1c46e37a768a2bcbf04010e579b046966c5b67dad1 |