Git Product home page Git Product logo

aws-cognito-react's Introduction

aws-cognito-react - v2

signin

If you are looking for v1 version it can be found on the legacy branch. With the release of v2, v1 is no longer supported

Reference implementation / boilerplate for AWS Cognito user management

Demo

aws-cognito-react-demo

v2 Changes

  • Switched to Typescript
  • Replaced redux and saga's with react context
  • Upgraded all libraries to latest major versions
  • No security scan issues
  • Hooks used to manage states
  • Updated to Material UI 4x
  • Added AWS CDK to manage infrastructure
  • Cleaner and simpler Architecture
  • Responsive design

AWS Cognito Infrastructure setup

To help deploy the AWS Cognito infrastructure I've create an Amazon Cloud Development (CDK) script

CDK set up instructions can be found here

CDK deploy instructions

cd cdk
npm run cdk bootstrap   # only needed first time
npm run cdk deploy

After deployment copy the userPoolId and userPoolClientId values from the command line window; you will need these values in the app config step

App Configuration

Setup the Cognito environment values buy creating app/.env.local file and adding the following

REACT_APP_USERPOOL_ID=YOUR_USER_POOL_ID
REACT_APP_CLIENT_ID=YOUR_CLIENT_ID

Create React App has been used to setup the development process so the next steps should be familiar

cd app
npm install
npm start

Other Solutions

Firebase Auth - Great for mobile and web. Fairly limited but easy to use. Integrates really nicely with other Firebase services

Auth0 - Comes with comprehensive and feature rich frontend. Seems to quicky get expensive but a very safe option

Keycloak - Excellent feature rich Enterprise service that offers fully themable frontend. No Cloud solution but easy to deploy to AWS using this CDK script

Useful References

https://www.npmjs.com/package/amazon-cognito-identity-js

https://docs.aws.amazon.com/cdk/api/latest/docs/aws-cognito-readme.html

https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-social-idp.html

https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html

aws-cognito-react's People

Contributors

dbroadhurst avatar dependabot[bot] avatar nagelflorian avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.