authlib / joserfc

Implementations of JOSE RFCs in Python

Home Page:https://jose.authlib.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Authlib JOSE RFC

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

GitHub Sponsor Build Status PyPI Code Coverage Maintainability Rating Security Rating

Usage

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

from joserfc import jwt

encoded = jwt.encode({"alg": "HS256"}, {"k": "value"}, "secret")
# 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrIjoidmFsdWUifQ.ni-MJXnZHpFB_8L9P9yllj3RNDfzmD4yBKAyefSctMY'

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

Features

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

And draft RFCs implementation of:

Useful Links

License

2023, Hsiaoming Yang. Under BSD-3 license.

About

Implementations of JOSE RFCs in Python

https://jose.authlib.org

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 99.8%Language:Makefile 0.1%Language:HTML 0.1%