Tooling for working with JWTs for Vonage APIs in Python.
Project description
Vonage JWT Generator for Python
This package (vonage-jwt) provides functionality to generate a JWT in Python code.
It is used by the Vonage Python SDK, specifically by the vonage-http-client package, to generate JWTs for authentication. Thus, it doesn't require manual installation or configuration unless you're using this package independently of an SDK.
For full API documentation, refer to the Vonage developer documentation.
Installation
Install from the Python Package Index with pip:
pip install vonage-jwt
Generating JWTs
This JWT Generator can be used implicitly, just by using the Vonage Python SDK to make JWT-authenticated API calls.
It can also be used as a standalone JWT generator for use with Vonage APIs, like so:
Import the JwtClient object
from vonage_jwt import JwtClient
Create a JwtClient object
jwt_client = JwtClient(application_id, private_key)
Generate a JWT using the provided application id and private key
jwt_client.generate_application_jwt()
Optional JWT claims can be provided in a python dictionary:
claims = {'jti': 'asdfzxcv1234', 'nbf': now + 100}
jwt_client.generate_application_jwt(claims)
Verifying a JWT signature
You can use the verify_jwt.verify_signature method to verify a JWT signature is valid.
from vonage_jwt import verify_signature
verify_signature(TOKEN, SIGNATURE_SECRET) # Returns a boolean
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vonage_jwt-1.1.5.tar.gz.
File metadata
- Download URL: vonage_jwt-1.1.5.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92dee47aa18092efc8c158f89cbe01ffaf7a976eef717c57b23e01c5491c795d
|
|
| MD5 |
01a7ea643e93a2dde09c2c4f959b5e76
|
|
| BLAKE2b-256 |
9c9c62682530eb7f576fc8675bd7cd5e2411d33280f1cc25bcdf05ee3f82b3e2
|
File details
Details for the file vonage_jwt-1.1.5-py3-none-any.whl.
File metadata
- Download URL: vonage_jwt-1.1.5-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2dea812ff271a75d495b703a1a27dcb7e457233f6237c2ad92cb815650004a7
|
|
| MD5 |
824cb87a55b59aa04acf93f041627916
|
|
| BLAKE2b-256 |
6a44be3af1d7333061fb15fd677305a50409f43714e74a67e7c59cf4a2811237
|