Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marekq/serverless-cognito
Authenticate your users through Cognito, Lambda and API Gateway. The script will set a local cookie in the browser and prompt for reauthentication by the user if needed.
https://github.com/marekq/serverless-cognito
Last synced: 14 days ago
JSON representation
Authenticate your users through Cognito, Lambda and API Gateway. The script will set a local cookie in the browser and prompt for reauthentication by the user if needed.
- Host: GitHub
- URL: https://github.com/marekq/serverless-cognito
- Owner: marekq
- License: apache-2.0
- Created: 2018-05-06T13:05:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-14T18:43:07.000Z (4 months ago)
- Last Synced: 2024-08-01T06:21:30.271Z (3 months ago)
- Language: Python
- Size: 96.7 KB
- Stars: 69
- Watchers: 3
- Forks: 15
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
serverless-cognito
==================
Authenticate your users through Cognito, Lambda, API Gateway and DynamoDB. The *build.sh* script will set a local cookie in the browser and prompt for reauthentication by the user if needed. A simple web UI is provided which allows users to register, login, logout, see their profile and see all users.The cookies are stored in a DynamoDB table that is part of the deployment. All user accounts are safely stored using a Cognito user pool. The Lambda function handles authentication, authorization and renders the HTML output. A second DynamoDB table is used to store the weblogs from user visits.
![alt text](./diagrams/main.svg)
You can easily deploy the solution using the [Serverless Application Repository](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:517266833056:applications~serverless-cognito).
Installation
------------There are two ways to install;
1. You can use the [Serverless Application Repository](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:517266833056:applications~serverless-cognito) to easily deploy the application in less than 2 minutes. Check the 'resources' tab under CloudFormation to find the login URL of your application.
2. Run 'build.sh' in the local directory to start a deploy using the SAM CLI.
Once you want to remove the service, simply delete the CloudFormation stack in your AWS account.
Roadmap (open to new suggestions)
---------------------------------- [ ] Add change password functionality for users.
- [ ] Add email or SMS validation for new accounts.
- [ ] Handle authentication using a custom authorizer in API Gateway.
- [ ] Add diagnostic pages (amount of users, last logins, etc.)
- [X] Add a fully functional profile with some user data.
- [X] Increase cookie security (better random generation and secure storage in browser).
- [X] Set TTL of 3 days for cookies set in browser.
- [X] Add fully functional login/logout.Contact
-------In case of questions or bugs, please raise an issue or reach out to @marekq!