JWT integration with Chalice
Project description
Json Web Token based authentication for Python Chalice
# Maintainers wantedChalice-JWT
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-jwt
install from source code
git clone https://github.com/marktennyson/chalice-jwt && cd chalice-jwt
python setup.py install --user
Compatibility
chalice-jwt
is compatiable with all python3 versions.
Not available for Python version 2.
Contributing
We welcome contributions of all types!
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
chalice-jwt-1.0.1.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for chalice_jwt-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df04773434e5d989cc2ca26939534e54180648b64c8238fa6d354cf67547e1a3 |
|
MD5 | 120f60990024eb8f1dbba83ebe3e5eac |
|
BLAKE2b-256 | 5338c7cfd55c8c58ece01073c207cd808d5a47496e8cd4ffdc68252ca2032a67 |