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-1.0.2.tar.gz
.
File metadata
- Download URL: zi_api_auth_client-1.0.2.tar.gz
- Upload date:
- Size: 2.8 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02609bb86c4a98de128f97f23e0f2d95a40c94b128c6c632446d46d75a012a41 |
|
MD5 | f23ae7411a4e817fdaf70a61efe95db3 |
|
BLAKE2b-256 | eb61fde93ee93abe31a6dac8fb6f8a562ca5db73a6094e27eda92fb0401dde07 |
File details
Details for the file zi_api_auth_client-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: zi_api_auth_client-1.0.2-py3-none-any.whl
- Upload date:
- Size: 4.0 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58fd25d74f8c3c7f4ffe492b9b2e3c65ed5526d16f9f2c5f77617faf9019cd10 |
|
MD5 | 421de4b82f2dad6ba742885928db0db6 |
|
BLAKE2b-256 | bb2598729d2aae42f97f86a07cb359094a252f3c11611ebff4faeec2de47eb54 |