Passport is the most widely used authentication module for Node.js. It's highly extendable and there are strategies for almost any kind of authentication there is. In this video, learn the general concept of Passport.
- [Narrator] Passport is the most widely-used authentication module for Node.js. Conceptually, Passport provides an authenticate function. This function uses a so-called strategy to authenticate the user. Strategies are pluggable authentication modules that can be installed separately. Through these strategies, Passport covers a lot of back ends or use cases from local authentication that is mostly used to authenticate against the local database to strategies for a variety of third-party systems, including single sign-on providers and logins via social media concepts, like Facebook, or other exotic systems Shoplet.
Right now, there are over 500 strategies available. Once Overview successfully authenticated, Passport also takes care of storing the user in the session, and restoring it for every request. To use Passport in Express, it needs to be hooked into the application with, you might've guessed it, two middle definitions. What do these two middle functions do? First we have initialize, it returns a middleware function that uses the request object to store passport internal data in.
And then, we need passport dot session. It looks for previously serialized user in the current session and uses a provided deserialization function to provide the user in request dot user to all following middlewares and routes. In the next videos, we are going to add Passport to our sample project and we will create a strategy to authenticate users against the database.
Author
Released
2/7/2019- Creating a template engine
- Using MongoDB and Mongoose for user management
- Authenticating and authorizing users
- Adding cookies and sessions to Express
- Creating a login form with Passport
- Handling file uploads
- Storing and serving images
- Deploying an Express application
- Securing an Express application
- Running behind a web server
Skill Level Advanced
Duration
Views
Related Courses
-
Advanced Node.js
with Alex Banks2h 3m Advanced -
Advanced Node.js: Scaling Applications
with Alex Banks1h 15m Advanced
-
Introduction
-
What you should know1m 20s
-
Get your tools ready2m 1s
-
1. Know the Building Blocks and Internals of Express
-
Important Express middleware1m 27s
-
2. Use MongoDB and Mongoose to Manage Users
-
Connecting to MongoDB3m 27s
-
3. Authenticate and Authorize Users
-
Introduction to Passport1m 39s
-
Adding Passport to Express3m 55s
-
Providing a logout link2m 1s
-
Protecting routes3m 35s
-
4. Handle File Uploads and Process Images
-
File upload basics3m 9s
-
Serving images6m 32s
-
-
5. Deployment and Running in Production
-
Add logging5m 3s
-
Conclusion
-
Next steps44s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Introduction to Passport