Python BSD-3-Clause

joserfc

Implementations of JOSE RFCs in Python

A

authlib

Dernière activité 13 sept. 2026
authlib/joserfc

178

étoiles

26

forks

0

issues ouvertes

josejwajwejwkjwsjwt

Ce README est souvent en anglais.

Authlib JOSE RFC

joserfc is a Python library that provides a comprehensive implementation of several essential JSON Object Signing and Encryption (JOSE) standards.

Build Status PyPI version conda-forge version PyPI Downloads Code Coverage Maintainability Rating Security Rating

Usage

A quick and simple JWT encoding and decoding would look something like this:

from joserfc import jwt, jwk

key = jwk.import_key("your-secret-key", "oct")
encoded = jwt.encode({"alg": "HS256"}, {"k": "value"}, key)
# 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJrIjoidmFsdWUifQ._M8ViO_GK6TnZ9G9eqdlS7IpNWzhoGwaYYDQ3hEwwmA'

token = jwt.decode(encoded, key)
print(token.header)
# {'alg': 'HS256', 'typ': 'JWT'}
print(token.claims)
# {'k': 'value'}

# validate claims (if needed)
claims_requests = jwt.JWTClaimsRegistry()
claims_requests.validate(token.claims)

Features

It follows RFCs with extensible API. The module has implementations of:

And draft RFCs implementation of:

License

2023, Hsiaoming Yang. Under BSD-3 license.

Projets similaires

A JOSE implementation in Python

Pythonjosejwtpython
Mmpdavis
1,8 k étoiles269

JSON Web Token implementation in Python

Pythonhacktoberfestjwtpython
Jjpadilla
5,7 k étoiles798

The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS, JWE, JWK, JWA, JWT included.

Pythondjangoflaskjose
Aauthlib
5,4 k étoiles567