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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file PyJWT-0.1.2.tar.gz.
File metadata
- Download URL: PyJWT-0.1.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bf95198d08f91adf59185f3f37228c974394d7bbd1dbbba620a17428d75387d
|
|
| MD5 |
523cf273edf1fe29885c08b98b5c8d53
|
|
| BLAKE2b-256 |
ee7ad693d3c40385d30a595a011151085abbfccaf38cbefa6f86143273d27fb1
|
File details
Details for the file PyJWT-0.1.2-py2.7.egg.
File metadata
- Download URL: PyJWT-0.1.2-py2.7.egg
- Upload date:
- Size: 6.3 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f8735e5ef24b4ebe20666b7eff302b0736f257e91b267c3ab0a02c7da5899e8
|
|
| MD5 |
4e0422517a5b88ec57a0be2cdeb5fa7d
|
|
| BLAKE2b-256 |
cb15513a1b21515741cd6dd5893f54249588c2bb60a8f58891b090a1a511f75a
|
File details
Details for the file PyJWT-0.1.2-py2.6.egg.
File metadata
- Download URL: PyJWT-0.1.2-py2.6.egg
- Upload date:
- Size: 6.3 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8aaa1bc305fa00e7d6e977ce3171f94dcf87c958734adfd30690d4d0cadaf44e
|
|
| MD5 |
6d08f6964d4fc5edd1457b207131997a
|
|
| BLAKE2b-256 |
3e2960e88a96eb0c2d73ee4e8901b5b9c8c27cf30c0077acd6f077aa6511d9a3
|
File details
Details for the file PyJWT-0.1.2-py2.5.egg.
File metadata
- Download URL: PyJWT-0.1.2-py2.5.egg
- Upload date:
- Size: 6.3 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d9bfc8f2226c42e44da0513a9164c536ae652210d005cd308891f900a5d272c
|
|
| MD5 |
4dc48c3dae693cb10946234f5ab01169
|
|
| BLAKE2b-256 |
d7e31c7bea3963f34d282c7a2bd1b8b0b11393f8bbd5e80a55501dc7f639433d
|