Skip to main content

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

vonage_jwt-1.1.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vonage_jwt-1.1.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file vonage_jwt-1.1.1.tar.gz.

File metadata

  • Download URL: vonage_jwt-1.1.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for vonage_jwt-1.1.1.tar.gz
Algorithm Hash digest
SHA256 15f4b1cd8fa5909390a4074a909053ae823df0557b1edb9b675d0a013295dc10
MD5 51a8508bca2e14c510e83f8c6363155f
BLAKE2b-256 657251ef0ffb4bb6c2fa9242444cfd6febce9a5ac45057ebf924a4b12a53b8bb

See more details on using hashes here.

File details

Details for the file vonage_jwt-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: vonage_jwt-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for vonage_jwt-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b751571e013deeab9f13b68f9e1478d8aa7f0a91f0cb7f6d793fa7b859859df
MD5 b89bdd60b3747120d71674fa3d326dd1
BLAKE2b-256 9e1cb9fd897425b739e0d50344e3713f35e7fb10fb6940442750f9fea60ff3eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page