Skip to main content

JSON Web Token library for Python 3.

Project description

https://travis-ci.org/GehirnInc/python-jwt.svg?branch=master https://coveralls.io/repos/GehirnInc/python-jwt/badge.png?branch=master https://badge.fury.io/py/jwt.svg?dummy

python-jwt

python-jwt is a JSON Web Token (JWT) implementation in Python developed by Gehirn Inc.

Examples

import json

from jwt import (
    JWT,
    jwk_from_dict,
    jwk_from_pem,
)

message = {
    'iss': 'https://example.com/',
    'sub': 'yosida95',
    'iat': 1485969205,
    'exp': 1485972805,
}

with open('rsa_private_key.pem', 'rb') as fh:
    signing_key = jwk_from_pem(fh.read())

jwt = JWT()
compact_jws = jwt.encode(message, signing_key, 'RS256')

with open('rsa_public_key.json', 'r') as fh:
    verifying_key = jwk_from_dict(json.load(fh))

message_received = jwt.decode(compact_jws, verifying_key)

assert message == message_received

Installation

You can install python-jwt with pip.

$ pip install jwt

Implementation Details

Supported Algorithms

  • Unsecured

    • none

  • Symmetric

    • HS256

    • HS384

    • HS512

  • Asymmetric

    • RS256

    • RS384

    • RS512

Supported Python Versions

  • Python 3.4

  • Python 3.5

  • Python 3.6

License

python-jwt is licensed under the Apache License version 2. See ./LICENSE.rst.

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

jwt-0.5.4.tar.gz (7.3 kB view details)

Uploaded Source

Built Distributions

jwt-0.5.4-py36-none-any.whl (12.8 kB view details)

Uploaded Python 3.6

jwt-0.5.4-py35-none-any.whl (12.8 kB view details)

Uploaded Python 3.5

jwt-0.5.4-py34-none-any.whl (12.8 kB view details)

Uploaded Python 3.4

File details

Details for the file jwt-0.5.4.tar.gz.

File metadata

  • Download URL: jwt-0.5.4.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for jwt-0.5.4.tar.gz
Algorithm Hash digest
SHA256 fd19dd38e12c32faa1af9769d2586b87334c3360446ca657295a498d0e163d98
MD5 809b4b6f7facc050d5046cb0878dc4b5
BLAKE2b-256 586945d4db4fc623d7e8879abb5057ad31472c2c283e8af13f2795363f26e467

See more details on using hashes here.

File details

Details for the file jwt-0.5.4-py36-none-any.whl.

File metadata

File hashes

Hashes for jwt-0.5.4-py36-none-any.whl
Algorithm Hash digest
SHA256 bf49e848996ed3f85f1cdbc6c45a66196bf46fbe33b85945091e6cfdde9a0d62
MD5 2c741cb59eb7dcbd7f2724a662d09105
BLAKE2b-256 8703543775e9ad9c29f99ddce4058c1562d45dbb2ef33adef5404fef7d3e853b

See more details on using hashes here.

File details

Details for the file jwt-0.5.4-py35-none-any.whl.

File metadata

File hashes

Hashes for jwt-0.5.4-py35-none-any.whl
Algorithm Hash digest
SHA256 ba4448cc4a161bbb649f50b98ce4a4b8016d6bfd6a2e33ffe0c7797ceb48ed82
MD5 3343d0ffc4c48102272f5a71895a9f1e
BLAKE2b-256 bd8e0379ed9f24c6ea5b1cd8b1293d84af0dbcbbc1d79ebc96062ebec08ee655

See more details on using hashes here.

File details

Details for the file jwt-0.5.4-py34-none-any.whl.

File metadata

File hashes

Hashes for jwt-0.5.4-py34-none-any.whl
Algorithm Hash digest
SHA256 4ff49a594462f04bff33de91121247a71952ddfbdeb8ad32c9d2f74eefe947cc
MD5 14b4847513206307bd5051776a39a20c
BLAKE2b-256 634f12988876959db9d4070a1139b42ae65576dfcc650011c4845c0bed9080a8

See more details on using hashes here.

Supported by

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