Skip to main content

Asymmetric JWT Authentication

https://img.shields.io/pypi/v/asymmetric_jwt_auth.svg https://gitlab.com/crgwbr/asymmetric_jwt_auth/badges/master/pipeline.svg https://gitlab.com/crgwbr/asymmetric_jwt_auth/badges/master/coverage.svg

What?

This is an library designed to handle authentication in server-to-server API requests. It accomplishes this using RSA public / private key pairs.

Why?

The standard pattern of using username and password works well for user-to-server requests, but is lacking for server-to-server applications. In these scenarios, since the password doesn’t need to be memorable by a user, we can use something far more secure: asymmetric key cryptography. This has the advantage that a password is never actually sent to the server.

How?

A public / private key pair is generated by the client machine. The server machine is then supplied with the public key, which it can store in any method it likes. When this library is used with Django, it provides a model for storing public keys associated with built-in User objects. When a request is made, the client creates a JWT including several claims and signs it using it’s private key. Upon receipt, the server verifies the claim to using the public key to ensure the issuer is legitimately who they claim to be.

The claim (issued by the client) includes components: the username of the user who is attempting authentication, the current unix timestamp, and a randomly generated nonce. For example:

{
    "username": "guido",
    "time": 1439216312,
    "nonce": "1"
}

The timestamp must be within ±20 seconds of the server time and the nonce must be unique within the given timestamp and user. In other words, if more than one request from a user is made within the same second, the nonce must change. Due to these two factors no token is usable more than once, thereby preventing replay attacks.

To make an authenticated request, the client must generate a JWT following the above format and include it as the HTTP Authorization header in the following format:

Authorization: JWT <my_token>

Important note: the claim is not encrypted, only signed. Additionally, the signature only prevents the claim from being tampered with or re-used. Every other part of the request is still vulnerable to tamper. Therefore, this is not a replacement for using SSL in the transport layer.

Full Documentation: https://asymmetric-jwt-auth.readthedocs.io

Metadata

Release files for asymmetric-jwt-auth 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asymmetric-jwt-auth 1.3.0
File Size Uploaded Provenance Actions
asymmetric_jwt_auth-1.3.0.tar.gz 139.4 kB With provenance Details for asymmetric_jwt_auth-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for asymmetric-jwt-auth 1.3.0
File Interpreter ABI Platform Actions
asymmetric_jwt_auth-1.3.0-py3-none-any.whl Python 3 none any Details for asymmetric_jwt_auth-1.3.0-py3-none-any.whl

Total release size: 192.1 kB

Release files / asymmetric_jwt_auth-1.3.0.tar.gz

Download URL asymmetric_jwt_auth-1.3.0.tar.gz
Size 139.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c4479a1b2fca412530f52e4c026c9f4a725430a077de61e36f3abba0c89fed87
BLAKE2b-256 checksum
How to use checksums
413b6c7b93490c0a68d05cdf0fa2e54bb81623e016c422cf2e9a219a0a18ab77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitLab CI/CD, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / asymmetric_jwt_auth-1.3.0-py3-none-any.whl

Download URL asymmetric_jwt_auth-1.3.0-py3-none-any.whl
Size 52.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed3413e23917873ad23e163c5e2b36a72824e858c7dcfbdb4f46b286d2acd0a5
BLAKE2b-256 checksum
How to use checksums
d75d9eba1434e0aae8773b1223f9e7945bf23b3ce730b04ce8af61ae15c5b52e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitLab CI/CD, verified by PyPI on Oct 26, 2026.

Transparency log

Security for asymmetric-jwt-auth 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for asymmetric_jwt_auth-1.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitLab CI/CD, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page