Skip to content

Integration between cognito and Node.js to create an authentication flow for a web site.

Notifications You must be signed in to change notification settings

tigrazone/AuthFlow-Nodejs-Cognito

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auth flow using cognito

Server & serverless

We can use cognito in a full serverless architecture (using lambda functions) or using a server in this example, we will work with an api rest server created with NODEJS.

With classic server:

N|Solid

Serverless:

N|Solid

Using Node.js:

In this repository you can download a nodejs server that allows as to communicate with aws cognito, allowing as to implement a authentication workflow.

To install:

$ npm install

To run:

$ npm start

To test: Load in Post man the JSON file "Auth flow.postman_collection.json" to test the server.

Server functionalities:

  • Login
  • Signup user
  • Verify tokens
  • Renew token
  • Change password

The signup workflow is very interesting, I attach a diagram of how function:

N|Solid

  1. The user make a signup request to the server.
  2. Cognito receives the user data, and sent to them an activation link, depends the setup that we choose, you can handle by differents ways.
  3. The use click the action link in the email.
  4. The browser go to the activarion url and cognito, set as verified the user.

About

Integration between cognito and Node.js to create an authentication flow for a web site.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%