MA
marktennyson/chalice-jwt
JWT based authentication service for Python Chalice micro framework.
Json Web Token based authentication for Python Chalice
# Maintainers wantedChalice-JWT
Downloads
chalice-jwt provides a simple interface for jwt based authentication with AWS Chalice microframework(serverless).
source code available at: https://github.com/marktennyson/chalice-jwt
Usage
from chalice import Chalice
from chalice_jwt import JWTManager
from datetime import timedelta
app = Chalice(app_name='test-jwt')
jwt = JWTManager(jwtSecret="top-secret-key", app=app)
@app.route('/')
def index():
return {'hello': 'world'}
@app.route('/get-token')
def token():
Identity:dict = {"email":"aniketsarkar@yahoo.com"}
return {'token': jwt.create_access_token(identity=Identity, expires_in=timedelta(seconds=60)),}
@app.route('/get-identity')
@jwt.its_required
def login():
return jwt.get_jwt_identity()Installation
chalice-jwt is available from pypi.
install using pip
pip install chalice-jwtinstall from source code
git clone https://github.com/marktennyson/chalice-jwt && cd chalice-jwt
python setup.py install --userCompatibility
chalice-jwt is compatiable with all python3 versions.
Not available for Python version 2.
Contributing
We welcome contributions of all types!
On this page
Languages
Python100.0%
Contributors
Latest Release
1.0.1April 12, 2021MIT License
Created April 12, 2021
Updated June 11, 2023