Skip to content

Python implementation of four endpoints for authorization code grant type using AWS Cognito and Lambda.

Notifications You must be signed in to change notification settings

JinlianWang/aws-lambda-authentication-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

aws-lambda-authentication-python

This project is to demo how to create a Lambda function in Python which performs user authentication using oAuth Authorization Code grant type through AWS Cognito. The details, such as workflows and sequence diagrams can be found at User authentication through authorization code grant type using AWS Cognito.

The project can be developed locally and deployed to production in AWS. See "Development" and "Deploy" sections for procedures.

Development

Use the following command to hot load any change in Python code.

export FLASK_APP=app.py
export FLASK_ENV=development
flask run

Use IntelliJ "debug ..." to debug and stop at breakpoints.

Deploy

Follow How to deploy a Flask app on AWS Lambda to set up Zappa, the tool that we use in order to deploy code to AWS Lambda. Zappa also sets up API Gateway fronting Lambda function and enables CORS support for Lambda proxy integration.

To deploy to AWS, use the following command to activate virtual environment and deploy changes to AWS.

source .env/bin/activate
zappa deploy dev

About

Python implementation of four endpoints for authorization code grant type using AWS Cognito and Lambda.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages