All Projects → SanderKnape → aws-cognito-app

SanderKnape / aws-cognito-app

Licence: other
A sample application that uses the AWS PHP SDK to implement AWS Cognito functionality

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to aws-cognito-app

Aws Aspnet Cognito Identity Provider
ASP.NET Core Identity Provider for Amazon Cognito
Stars: ✭ 111 (+24.72%)
Mutual labels:  cognito
cognito-go-auth
Simple library to sign requests using cognito Google federated authentication.
Stars: ✭ 16 (-82.02%)
Mutual labels:  cognito
terraform-aws-cognito-user-pool
A Terraform module to create and manage Cognito User Pools (Simple and Secure User Sign-Up, Sign-In, and Access Control) on Amazon Web Services (AWS). https://aws.amazon.com/cognito
Stars: ✭ 46 (-48.31%)
Mutual labels:  cognito
Cognito Backup Restore
AIO Tool for backing up and restoring AWS Cognito User Pools
Stars: ✭ 142 (+59.55%)
Mutual labels:  cognito
Terraform Aws Cognito Auth
Serverless Authentication as a Service (AaaS) provider built on top of AWS Cognito
Stars: ✭ 248 (+178.65%)
Mutual labels:  cognito
noiiice
a serverless blog built on NuxtJS, AWS, serverless framework, and irrational exuberance.
Stars: ✭ 42 (-52.81%)
Mutual labels:  cognito
React Cognito Auth
A sample authentication app implemented with a server-less architecture, using cognito User Pools, API Gateway, react
Stars: ✭ 76 (-14.61%)
Mutual labels:  cognito
aws-cloudformation-cognito-identity-pool
A Lambda-backed Custom Resource for a Cognito Identity Pool in CloudFormation
Stars: ✭ 35 (-60.67%)
Mutual labels:  cognito
openapi-tf-example
Example of how you can use OpenAPI with AWS API Gateway, Also includes integrations with AWSLambda, AWS Cognito, AWS SNS and CloudWatch logs
Stars: ✭ 38 (-57.3%)
Mutual labels:  cognito
cognito-srp
Go library for AWS Cognito SRP
Stars: ✭ 40 (-55.06%)
Mutual labels:  cognito
Cognito Express
Authenticates API requests on a Node application by verifying the JWT signature of AccessToken or IDToken generated by Amazon Cognito.
Stars: ✭ 165 (+85.39%)
Mutual labels:  cognito
Retail Demo Store
AWS Retail Demo Store is a sample retail web application and workshop platform demonstrating how AWS infrastructure and services can be used to build compelling customer experiences for eCommerce, retail, and digital marketing use-cases
Stars: ✭ 238 (+167.42%)
Mutual labels:  cognito
terraform-aws-cognito-user-pool
Terraform module to create Amazon Cognito User Pools, configure its attributes and resources such as app clients, domain, resource servers. Amazon Cognito User Pools provide a secure user directory that scales to hundreds of millions of users.
Stars: ✭ 65 (-26.97%)
Mutual labels:  cognito
Django Cognito Jwt
An Authentication backend for Django Rest Framework for AWS Cognito JWT tokens
Stars: ✭ 127 (+42.7%)
Mutual labels:  cognito
cognito-jwt-verifier
Verify ID and access JWT tokens from AWS Cognito in your node/Lambda backend with minimal dependencies.
Stars: ✭ 25 (-71.91%)
Mutual labels:  cognito
Aws Cli Cheatsheet
☁️ AWS CLI + JQ = Make life easier
Stars: ✭ 94 (+5.62%)
Mutual labels:  cognito
amazon-ivs-ugc-web-demo
This repository shows how you can build a compelling user-generated content (UGC) live streaming webapp with Amazon IVS.
Stars: ✭ 14 (-84.27%)
Mutual labels:  cognito
cognito-to-dynamodb-lambda
Copy newly-confirmed users from Cognito to DynamoDB
Stars: ✭ 68 (-23.6%)
Mutual labels:  cognito
serverless-stack-demo-user-mgmt-client
Source for demo app client with user management in Serverless-Stack.com
Stars: ✭ 41 (-53.93%)
Mutual labels:  cognito
ses-email-client
Simple, serverless client for AWS SES. With this, you can send/read emails received by SES into S3 without purchasing AWS Workmail. If you only use SES for email marketing, you can also see and preview your SES templates in the browser
Stars: ✭ 21 (-76.4%)
Mutual labels:  cognito

AWS Cognito sample application

This sample application shows some basic functionality written against AWS Cognito. The following functionality is covered;

  • User registration
  • User login
  • Accessing a secured page if logged in
  • Resetting a forgotten password
  • Logout

The application is written in PHP. I've tried to keep the code as simple as possible so that it can be used as an example for other languages as well. In addition, I have written a blog post where I explain how to get started with AWS Cognito. There you will find more theory and background about how to implement AWS Cognito.

The steps to get started are divided in two sections;

  1. Set up AWS Cognito with the correct configuration
  2. Configure and start the application

Set up AWS Cognito with the correct configuration

First we will set up a new AWS Cognito user pool with the correct configuration.

  1. Visit your AWS console and go to the AWS Cognito service. Click on "Manage your User Pools" and click "Create a User Pool".
  2. Specify a name for your pool and click "Review Defaults".
  3. Optional: edit the password policy to remove some of the requirements. If you are just testing, using simple passwords will make it easier.
  4. Click the "edit client" link. Specify a name for your app and be sure to disable the client secret and enable the ADMIN_NO_SRP_AUTH option.
  5. Click "Create pool". Take note of the Pool Id at the top of the page and click on the apps page. Here, take note of the App client id.
  6. Create a new file called .env next to the Dockerfile. Add the AWS region you are using, the pool ID and the client ID to this file. For the proper format, see below.
  7. There are two methods for setting up the required AWS credentials for communicating with the AWS CLI:
  8. The recommended way is to spin up an EC2 instance with a role. You then assign the correct permissions to this role.
  9. If you want to spin up the application outside of AWS, you will need an AWS user. Create an AWS User and get the access token and secret key. Add these to the .env file (see below).
  10. For testing, you can attach the AmazonCognitoPowerUser policy to either the created role or the user.

That should be it! The format is the .env file is as follows:

REGION=eu-west-1
CLIENT_ID=eu-west-1_abc123
USERPOOL_ID=abc123
AWS_ACCESS_KEY_ID=123 (Optional)
AWS_SECRET_ACCESS_KEY=abc (Optional)

Configure and start the application

With the AWS Cognito user pool set up and the correct configuration added to the .env file, we can start the application.

  1. Install Docker and Install Docker Compose. As mentioned, it is recommended to run the application on an EC2 instance so you don't need AWS access credentials.
  2. Clone this repository: git clone https://github.com/SanderKnape/aws-cognito-app.git
  3. Cd into the git repository and spin up the application with docker-compose up -d.
  4. The application is now running on port 80. Check it out! You will be able to create a user (with your correct e-mailaddress to receive the token), confirm the signup, login, and more.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].