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.3.tar.gz (3.2 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.3-py2.7.egg (6.4 kB view details)

Uploaded Egg

PyJWT-0.1.3-py2.6.egg (6.4 kB view details)

Uploaded Egg

PyJWT-0.1.3-py2.5.egg (6.4 kB view details)

Uploaded Egg

File details

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

File metadata

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

File hashes

Hashes for PyJWT-0.1.3.tar.gz
Algorithm Hash digest
SHA256 28b03b546803383fc26509273f357ef2986011f6c03975574d7f67004028f343
MD5 63d491d84e49a8041781065beaafb75a
BLAKE2b-256 19812e665ff384dff79c5530dfa862d8c76bb747db2bebb1e585da2ab79487cd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for PyJWT-0.1.3-py2.7.egg
Algorithm Hash digest
SHA256 96b88a4b07be0eccb4bd4945c06802c4dc3be605f374a792eaaf7d40b61afc72
MD5 16e24d126a650ea33b80d5ab84fb442c
BLAKE2b-256 9a0587c4847ed23c9b45ab526c07d2b3a80424fe8b5705bc4b3b57eb6cef450f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for PyJWT-0.1.3-py2.6.egg
Algorithm Hash digest
SHA256 f18f442a524b68cbcf40d944826ae7ed7d9a764e1d781f979f278e94e38c0d37
MD5 60cad4db521077cbd5012c9305d6d4b4
BLAKE2b-256 98b39b01ec4a9a9fe97266ef8959d0c8dfb149bda0061390fa8990a5bf56eb54

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for PyJWT-0.1.3-py2.5.egg
Algorithm Hash digest
SHA256 f07afb3e39340030bb22ab407aec1ba080b7c9b46b12a0e1ddaf42be4bcadfbf
MD5 b6e6193f979cd7198858f3bee395bfb6
BLAKE2b-256 92f86c4db50db1c828a4fb00527628f776892042e08d08ee3d7c6221795a4ca3

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