Skip to main content

JSON Web Token implemtnation in Python

Project description

A Python implementation of [JSON Web Token draft 01](http://self-issued.info/docs/draft-jones-json-web-token-01.html).

Installing

sudo easy_install PyJWT

Usage

import jwt jwt.encode({“some”: “payload”}, “secret”)

Note the resulting JWT will not be encrypted, but verifiable with a secret key.

jwt.decode(“someJWTstring”, “secret”)

If the secret is wrong, it will raise a jwt.DecodeError telling you as such. You can still get at the payload by setting the verify argument to false.

jwt.decode(“someJWTstring”, verify=False)

Algorithms

The JWT spec supports several algorithms for cryptographic signing. This library currently supports:

  • HS256 - HMAC using SHA-256 hash algorithm (default)

  • HS384 - HMAC using SHA-384 hash algorithm

  • HS512 - HMAC using SHA-512 hash algorithm

Change the algorithm with by setting it in encode:

jwt.encode({“some”: “payload”}, “secret”, “HS512”)

Tests

You can run tests from the project root after installed with:

python tests/test_jwt.py

License

MIT

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

PyJWT-0.1.4.tar.gz (4.5 kB view details)

Uploaded Source

Built Distributions

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

PyJWT-0.1.4-py2.7.egg (8.0 kB view details)

Uploaded Egg

PyJWT-0.1.4-py2.6.egg (8.0 kB view details)

Uploaded Egg

PyJWT-0.1.4-py2.5.egg (8.0 kB view details)

Uploaded Egg

File details

Details for the file PyJWT-0.1.4.tar.gz.

File metadata

  • Download URL: PyJWT-0.1.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyJWT-0.1.4.tar.gz
Algorithm Hash digest
SHA256 1d861c07a27aba8449b55fd219629e4bef0c89c95df346f2b446460bd9dc1fbd
MD5 d9c5e02a629bac1e567a3be2f8b3825c
BLAKE2b-256 339153303e612e0d98d0485c27eb941d3db87b65dae0dcc0ffbd85c56ba3718a

See more details on using hashes here.

File details

Details for the file PyJWT-0.1.4-py2.7.egg.

File metadata

  • Download URL: PyJWT-0.1.4-py2.7.egg
  • Upload date:
  • Size: 8.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyJWT-0.1.4-py2.7.egg
Algorithm Hash digest
SHA256 41134fba741dc358ea65e25c67203bfa7b426489a70364b649b843fcea4d7f04
MD5 4b7f969668b3b7b7095d01de5c0cf6b0
BLAKE2b-256 3c147b09ff51a36b23c5fbc8ac9ff5e5d76b641d3b397c22f661d9d471eb5f03

See more details on using hashes here.

File details

Details for the file PyJWT-0.1.4-py2.6.egg.

File metadata

  • Download URL: PyJWT-0.1.4-py2.6.egg
  • Upload date:
  • Size: 8.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyJWT-0.1.4-py2.6.egg
Algorithm Hash digest
SHA256 f5577d5a0909b836bb98ac430dc8033185830415a13dfe2366359e9021aa1493
MD5 5e7c95ee1a53b27145df2d0e35abd011
BLAKE2b-256 82b4cfcd677ab6f027816e5b8ac195e039d9f04fe087d6c98a8bb537bbc5efd6

See more details on using hashes here.

File details

Details for the file PyJWT-0.1.4-py2.5.egg.

File metadata

  • Download URL: PyJWT-0.1.4-py2.5.egg
  • Upload date:
  • Size: 8.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyJWT-0.1.4-py2.5.egg
Algorithm Hash digest
SHA256 439d22e2ac717777925aa7b217383c1b8e09003358b21c940168cffe263747de
MD5 f88d589ec5da1df310820afc005c78a4
BLAKE2b-256 875ad8b3a0cb334a873471b65e6dde320c01aabdcbf717352a05403d4f4bee66

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