User Authentication in Web Apps (Passport.js, Node, Express)

Wordpress sites

In this full course for beginners, you will learn how to implement user authentication from scratch in your web apps. You will learn how to use Passport.js in a Node / Express app.

💻 Starter Code
🔗
🔗

✏️ Course created by Zach Gollwitzer. Check out his channel:

⭐️ Course Contents ⭐️
⌨️ (0:00:00) Introduction
⌨️ (0:04:04) Topics and Prerequisites
⌨️ (0:16:43) Intro to HTTP Headers and Cookies
⌨️ (0:34:23) Intro to Express Middleware
⌨️ (1:05:04) Intro to Express Sessions
⌨️ (1:31:10) Implementation of Passport Local Strategy
⌨️ (2:50:21) Intro to Public Key Cryptography
⌨️ (3:34:31) How do JWTs work?
⌨️ (4:16:58) Implementation of Passport JWT Strategy
⌨️ (5:17:29) Implementing a Custom JWT Auth Solution
⌨️ (5:46:20) JWT Strategy in Angular Front-End App

Learn to code for free and get a developer job:

Read hundreds of articles on programming:

And subscribe for new videos on technology every day:

25 thoughts on “User Authentication in Web Apps (Passport.js, Node, Express)”

  1. Zach Gollwitzer

    Thanks for watching everyone! I really hope you enjoy this as much as I enjoyed putting it together. If you have a spare second, I’d really appreciate it if you checked out my web dev channel 🙂 Also, a big thanks to FCC for everything they do. FCC + YouTube is where I started my journey and I’m pumped to see how much growth this organization has had!

    1. man you are absolutely awesome, I realized I had so many gaps in my knowledge and this video elegantly filled them all ❤❤

    2. Thank you Zach ^^’
      I just wanna ask you
      when deploying the App should I include the two generated files [private + public key] apparently NO the answer
      but I really wanna know some information how or where I should store the two files .
      Thank you again

  2. Awesome class and instruction. Your teaching and examples have an easy to follow narrative and flow to them! Great job!

  3. To my name sake, this is really well done! I am a mid level node developer and found the steps and extra bits you gave to be outstanding and more then worth the time spent going through it. Well done sir!

  4. Special thanks to Zach and FCC for this awesome tutorial. Really learned a lot from this tutorial. Keep coming with these type of tutorials :))

  5. Few important things you need to know or you may get confused at one point in this tutorial:
    1. RSA + SHA256 = RSA256 = RSA-SHA256 = RS256
    2. RSA is the algorithm to encrypt the hashed message. And SHA256 is an algorithm to create the hashed text from the original text.
    3. There are three ways you could create JWT in this tutorial:
    i) using base nodejs crypto library(Zach has shown only how to encrypt and decrypt and sign a message with this, though if you understand this well then you can create JWT for yourself)
    ii)using signatureFunction. This is where I personally found myself a little uneasy about the use of crypto.createSign(‘RSA-SHA256’) without much explanation of this line. Actually, the signature function does both the things in the background i.e. hashing and then encrypting. For hashing we want it to use SHA256 and for encrypting RSA. Hence we provide RSA256 as a combination of the two in the crypto.createSign method!
    iii) using jsonwebtoken npm library (very easy way to implement). The passport-jwt strategy also uses this library in the hindsight!

  6. Christian Komodo

    Your videos are great! Thorough and beginner-friendly but brings you through the whole thing. Perfect!

  7. Benjamin Castro

    Can’t thank you enough for this tutorial. I have also watched several tutorials that have left me with more doubts than answers, so I appreciate how thorough this tutorial is. Amazing job!

  8. Rikard Cederberg

    Thank you for this really in depth tutorial.
    I would love to see more like this on other React and web development stuff.
    Keep up the good work.

  9. chandi sannidhanam

    Thanks ! Zach for the great tutorial ! it’s really awesome course on the User Authentication ! All 6 :13 hours is really worth, loaded with full of information , which I can really apply .

  10. CHITUS💖⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻

    Can’t thank you enough for this tutorial. I have also watched several tutorials that have left me with more doubts than answers, so I appreciate how thorough this tutorial is. Amazing job!

  11. Keaton Robinson

    thank you! This was great! I had watched a few quick tutorials elsewhere but had no idea why I was copying and pasting all the stuff they prescribed. This gave me an actual understanding of what everything is doing.

  12. Abdurrahim Ahmadov

    Thank you for this amazing course! This course and FCC QA curriculum helped me a lot to understand the passport framework.

  13. This is one of the best tutorials I have ever encountered! Thanks so much for your time and effort. I learned a lot.

  14. First of all, thank you for taking the time to do such a great video!!
    Quick question, I haven’t worked with Angular but have worked with React and I am currently starting to look at Next JS, I was wondering if this would be much different to implement into Next JS?
    Thank you

  15. Sumit Prajapati

    Thank you for your efforts. Sharing knowledge is easy but delivering in such a way that everyone can understand is very much difficult. We need a hell a lot of preparation for that. Hats off to your efforts.

  16. Thank you very much for teaching so conscientiously. It was obvious you cared that people who are trying to learn will understand. I watched someone else’s video and he went so fast and didn’t explain a lot, and that can get frustrating and discouraging. It’s so nice that you guide us at a proper pace for students.

  17. Fatty BoomBatty

    Zach, one thing I really like about your videos is that you don’t edit out the mistakes when you make them, but correct them in full view. I find this useful as it gives me the opportunity to think why something didn’t work too. It is a really helpful learning aid (well for me it is).

  18. Probably the best tutorial online for user authentication! Excellent delivery of the middleware concept with user authentication flow. @Zach Gollwitzer, you’re a legend! Keep up the great work.

Comments are closed.