User Authentication Passport Jason Situ Passport What is it? - - PowerPoint PPT Presentation

user authentication
SMART_READER_LITE
LIVE PREVIEW

User Authentication Passport Jason Situ Passport What is it? - - PowerPoint PPT Presentation

User Authentication Passport Jason Situ Passport What is it? Passport is authentication middleware for Node. It is designed to serve a singular purpose: authenticate requests. Supports a comprehensive set of authentication mechanisms called


slide-1
SLIDE 1

Jason Situ

User Authentication

Passport

slide-2
SLIDE 2

Passport

slide-3
SLIDE 3

What is it?

Passport is authentication middleware for Node. It is designed to serve a singular purpose: authenticate requests. Supports a comprehensive set of authentication mechanisms called strategies Strategies are packaged as individual modules that makes it easy to plug different forms of authentication into a web application

http://www.passportjs.org/docs/

slide-4
SLIDE 4

Configuring Passport

app.use - add middleware required to initialize passport and support user sessions

slide-5
SLIDE 5

Using Strategies

Strategies supplied via use() 
 Strategies require what’s known as a verify callback which is code that finds a user with given credentials

slide-6
SLIDE 6

Using Strategies

The verify callback is invoked with the given credentials as arguments. If they’re valid, done is invoked with the user that was authenticated and passes that user to Passport

slide-7
SLIDE 7

Using Sessions

If authentication succeeds, a session will be established and maintained as cookie in the user’s browser Subsequent requests will contain the unique cookie that identifies the user Passport will serialize the user instance into the session for you

slide-8
SLIDE 8

How do we handle username, password, and security?

slide-9
SLIDE 9

Never store passwords in plain text! Use bcrypt

MP3

https://plaintextoffenders.com/

slide-10
SLIDE 10

DEMO

slide-11
SLIDE 11

Problem with Passport and ReactJS

React has its own router management

slide-12
SLIDE 12

Problem with Passport and ReactJS

Built callback will not work, use Custom Callback instead

slide-13
SLIDE 13

Don’t like MongoDB? No problem!

slide-14
SLIDE 14
slide-15
SLIDE 15

FIREBASE

Realtime Database Authentication Serverless Hosting

slide-16
SLIDE 16

QUESTIONS?