Decode and verify Amazon Cognito JWT tokens
Project description
Decode and verify Amazon Cognito JWT tokens
Note: tested on Python >= 3.6, compatible with PEP-492 (async/await coroutines syntax)
Installation
pip install cognitojwt
Usage
import cognitojwt
id_token = '<YOUR_TOKEN_HERE>'
REGION = '**-****-*'
USERPOOL_ID = 'eu-west-1_*******'
APP_CLIENT_ID = '1p3*********'
verified_claims = cognitojwt.decode(
id_token,
REGION,
USERPOOL_ID,
APP_CLIENT_ID,
testmode=True # disable token expiration checking for testing purposes
)
# async
verified_claims = await cognitojwt.decode_async(
id_token,
REGION,
USERPOOL_ID,
APP_CLIENT_ID,
testmode=True # disable token expiration checking for testing purposes
)
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
cognitojwt-1.0.0.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for cognitojwt-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5617a5e6e2c8852a9ee9509e2e3a6c3edae2e1869dcc27b9c9147a385f778105 |
|
MD5 | ccee2280fe4b5c1c8c366110fb1385b1 |
|
BLAKE2b-256 | 6c9bcc4e97d100ce96a1d0c733a211ca926e4cfb04dcdce8c175649d33a502ae |