Skip to content
/ PyRTK Public

PyRTK allows you to create and decode refresh tokens for JSON Web Token authentication systems.

License

Notifications You must be signed in to change notification settings

jdraiv/PyRTK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyRTK

PyRTK allows you to create and decode refresh tokens for JSON Web Token authentication systems.

Installing

You can install the package using pip or pipenv.

$ pip install pyrtk

$ pipenv install pyrtk

Usage

import pyrtk

>>> refresh_token = pyrtk.create_token({'identity': 'tester'}, 'secretKey')
'gAAAAABcetXLTFVJO_BjCHVF5xKKwCj1goqiU9uR4osHwxqNJ6Mnl1YWvQn-m6EjPs3wyIjsoB3-R70rj7XFl2GuU5u6Q-3Z7tSa1VeDVDiEHPL50hxa0SEMunwqT5lyc8XkyT-A8zdt'

>>> decoded_token = pyrtk.decode_token(refresh_token, 'secretKey')
{'identity': 'tester'}

Please note that the secret key must be urlsafe base64 encoded. You can use the function generate_key() to generate a random key.

>>> key = pyrtk.generate_key()
b'hSwQxJETF2ISuk4fgUNmP1k8r1JkcSz2Ijrq8_wa_ws='

About

PyRTK allows you to create and decode refresh tokens for JSON Web Token authentication systems.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages