Skip to content

Decode and verify Amazon Cognito JWT tokens

License

Notifications You must be signed in to change notification settings

hngkr/cognitojwt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
)

About

Decode and verify Amazon Cognito JWT tokens

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%