Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lbaiyat/cognito-flask-auth-demo
Flask application with UI and REST API endpoints to manage user registration and authentication through AWS Cognito.
https://github.com/lbaiyat/cognito-flask-auth-demo
aws boto3 cloudformation cognito cognito-user-pool flask python3 rest-api
Last synced: about 1 month ago
JSON representation
Flask application with UI and REST API endpoints to manage user registration and authentication through AWS Cognito.
- Host: GitHub
- URL: https://github.com/lbaiyat/cognito-flask-auth-demo
- Owner: lbaiyat
- Created: 2024-05-09T20:17:44.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-27T21:59:09.000Z (8 months ago)
- Last Synced: 2024-05-28T07:56:28.912Z (7 months ago)
- Topics: aws, boto3, cloudformation, cognito, cognito-user-pool, flask, python3, rest-api
- Language: HTML
- Homepage:
- Size: 271 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Cognito Flask Auth Demo
Table of Contents
- Overview
- About AWS Cognito
Instructions
- Setup virtual environment
- Export AWS Access Key and Secret Key to environment variables
- Create the Cognito User Pool with the Stream Manager Script
- Run the Flask App
Pages
Cleanup
Overview:
This is a demo application created using Flask and Cognito to display a UI that manages user registration and authentication. There are rendered html pages and REST API endpoints that correspond to the registration, authentication, and authenticated user view.About AWS Cognito:
AWS Cognito is a service that enables developers to add user sign-up, sign-in, and access control to their web and mobile applications quickly and securely. It supports user authentication, authorization, and user management, allowing integration with social identity providers and enterprise identity providers via SAML 2.0.Instructions:
Getting the application up and running requires a few steps outlined below.
Setup virtual environment
python3 -m venv venv;
pip install -r requirements.txt;
Export AWS Access Key and Secret Key to environment variables
export AWS_ACCESS_KEY_ID="{ACCESS_KEY_ID_STRING}";
export AWS_SECRET_ACCESS_KEY="{AWS_SECRET_ACCESS_KEY_STRING}";
Create the Cognito User Pool with the Cognito Pool Manager Script
Note: The 'create' keyword after the script is needed. Creating this Data Stream will incur AWS charges
python3 cognito_pool_manager.py create;
Run the Flask App
python3 app.py;
Once the Flask app is running, you should be able to access the webpagePages:
Login Page:
Registration Page
Logged In Page
Cleanup:
Once you are done with using the Cognito User Pool, you should delete the instance to stop incurring further charges.
Delete the Cognito User Pool with the Cognito Pool Script
Note: The 'delete' keyword after the script is needed. The CloudFormation stack will be deleted as well as the Kinesis Stream defined by it.
python3 cognito_pool_manager.py delete;