joshuaai / node-passport

Testing Passport.js on Node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node with Passport JS and Redis.io

The Node.js Authentication Flow

  1. User enters username and password
  2. The application checks if they are matching
  3. If they are matching, it sends a Set-Cookie header that will be used to authenticate further pages
  4. When the user visits pages from the same domain, the previously set cookie will be added to all the requests
  5. Authenticate restricted pages with this cookie

Auth Strategy

  • Setup Express
  • Setup Passport for Node JS
  • Add protected endpoints
npm install --save express passport express-session connect-redis

About

Testing Passport.js on Node


Languages

Language:JavaScript 88.0%Language:HTML 12.0%