squidfunk/terraform-aws-cognito-auth hiện có 298 sao trên GitHub, viết chủ yếu bằng TypeScript. [UNMAINTAINED] Serverless Authentication as a Service (AaaS) provider built on top of AWS Cognito
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
⚠️ UNMAINTAINED: I'm lacking the time to keep this project updated, which is
why this project will not receive any further updates. Use it at your own
risk. Issues have been disabled.
Terraform AWS Cognito Auth
Add authentication to your Single Page Application (SPA) within minutes and
take full control of the authentication flow including customizable email
templates and a beautiful default UI. See the live demo.
A Terraform module to setup a serverless and easily customizable Authentication
as a Service (AaaS) provider in front of API Gateway using AWS Cognito User
Pools.
Features
Authentication using email and password or refresh token
Registration, password reset and verification
Completely customizable transactional emails
Optional multi-part default email templates (see screenshots)
Optional beautiful and mobile-friendly default UI (see screenshots)
Federated identities using Cognito Identity Pools and User Pools
A+ security rating on Mozilla Observatory (CSP, HSTS, etc.)
Excessively tested with automated unit and acceptance tests
Serverless, extremely scalable and cost effective
However, there are some limitations
Architecture
This module creates a REST API using AWS API Gateway, Lambda and Cognito User
Pools to enable registration, authentication and account recovery without the
necessity for the implementation of complex OAuth authentication flows. It was
originally inspired by LambdAuth but uses User Pools in favor of Identity
Pools because exposing (even temporary) AWS credentials is a security threat.
Account registration and recovery circumvent Cognito's default verification
logic and emit verification codes to an SNS topic which can be hooked up to a
Lambda function handling delivery via SES using default multi-part email
templates. This behavior is optional and can be customized by implementing a
custom Lambda function handling email delivery. Furthermore, a beautiful and
mobile-friendly default UI can be deployed to a custom subdomain within
your hosted zone.
Cost
AWS Cognito is free for up to 50.000 monthly active users. After that,
pricing starts at $ 0,0055 per monthly active user. Additional cost will be
attributed to AWS Lambda, API Gateway and CloudFront but it should be very
reasonable compared to what AaaS providers like Auth0 charge. While this module
does not provide all features offered by other providers, it should be quite
sufficient for securing a Single Page Application.
Usage
Add the following module to your Terraform configuration and apply it:
All resources are prefixed with the value specified as namespace. If the S3
bucket name (see below) is not explicitly set, it's set to the given namespace
which means there must not already exist an S3 bucket with the same name. This
is a common source of error.
The cognito_identity_pool_provider should match the domain name under which
the authentication provider should be deployed, i.e. it should be equal to
app_domain. Also note that SES is sandboxed by default, so every email address
needs to be verified for delivery. Contact AWS to exit sandboxed mode for
production use.
Also see the example configuration and the live demo.
Implies: app_hosted_zone_id, app_certificate_arn and app_domain
Default: ""
bucket
Description: S3 bucket name to store static files
Default: "${var.namespace}" (equal to namespace)
Email delivery
ses_sender_address
Description: SES sender email address
Default: ""
Example
Let's say we want to secure an application hosted on admin.example.com using
the default UI. First, add the following lines to your Terraform configuration
and apply it:
Now, when the user visits admin.example.com/dashboard, the initial API request
should detect a 401 Unauthorized response for an invalid or expired identity
token and redirect to the default UI:
https://login.example.com/?redirect=dashboard
After successful authentication, the default UI will redirect to the URL
specified in app_origin appending the path part specified in the redirect
parameter and the identity token in an URI fragment:
Then, after parsing the URI fragment and extracting the token, the application
can repeat the request including the identity token as an authorization header:
Authorization: Bearer <token>
If the user checks the Remember me checkbox during the authentication
process, a refresh token which is valid for 30 days is issued and sent to the
client as a secure HTTP-only cookie. When the access token expires after 1 hour,
the client is again redirected to the default UI which will immediately perform
a password-less authentication using the refresh token.
To sign out, the application must redirect the user to the following URL:
https://login.example.com/leave
This will invalidate all tokens including the refresh token stored in the
secure HTTP-only cookie.
Demo
Live demo
A live demo of this project can be found here. Please note that emails
are configured to remain undelivered due to security reasons. If you want to
try authentication, you may use the following credentials:
The target domain is localhost:8000, so you can start a local development
server on that port in order to receive the identity token after a successful
authentication attempt.
Screenshots
Default UI
Emails
Limitations
By default, AWS Cognito does only allow minor customizations of the whole
authentication flow - specifically multi-part emails are not supported; welcome
to the 21st century. To work around these restrictions registration and password
reset were decoupled using the Cognito Identity Service Provider admin APIs.
Verification is implemented with custom verification codes and email delivery.
License
MIT License
Copyright (c) 2018-2019 Martin Donath
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
squidfunk/terraform-aws-cognito-auth thuộc nhóm Security trên TopGit, cùng 7 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về squidfunk/terraform-aws-cognito-auth ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/squidfunk/terraform-aws-cognito-auth là nguồn chính thức.
squidfunk/terraform-aws-cognito-auth có phải mã nguồn mở không?
Có — squidfunk/terraform-aws-cognito-auth phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/squidfunk/terraform-aws-cognito-auth.
squidfunk/terraform-aws-cognito-auth có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho squidfunk/terraform-aws-cognito-auth. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
squidfunk/terraform-aws-cognito-auth dùng license gì?
squidfunk/terraform-aws-cognito-auth phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
squidfunk/terraform-aws-cognito-auth là gì?
squidfunk/terraform-aws-cognito-auth (squidfunk/terraform-aws-cognito-auth) là dự án TypeScript trên GitHub. Theo mô tả gốc: [UNMAINTAINED] Serverless Authentication as a Service (AaaS) provider built on top of AWS Cognito
Vì sao squidfunk/terraform-aws-cognito-auth được xếp vào nhóm Security?
TopGit xếp squidfunk/terraform-aws-cognito-auth vào nhóm Security dựa trên GitHub topics và mô tả của repo (gắn thẻ: "aaas", "authentication", "aws"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
terraform-aws-cognito-auth có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về terraform-aws-cognito-auth.