Skip to content
0:00 / 0:00

#jwt#authentication#express

JWT Authentication Tutorial - Node.js

Web Dev Simplified

1.7M subscribers • 6 videos on Hallway

YouTube
  • Recommended by 3 people: 3 in engineering communities.
  • Linked in the descriptionWebDevSimplified/JWT-Authentication
  • May be out of date. Uploaded 7 years ago, in an area where tools change fast.

Intermediate. Assumes working knowledge.

1.2M views7 years ago3 recommendations

Web developmentSecurityNode.js, Deno and BunCryptography

This tutorial shows how to implement secure JSON Web Token authentication and refresh tokens in a Node.js application.

*Become a web developer* with my *FREE Web Development Roadmap* - _260+ videos, 120+ projects, 60+ articles_ 👉 webdevsimplified.com/web-dev-roadmap.html JSON web tokens are one of the more popular ways to secure applications, especially in micro-services, but JWT is much more complex than a simple session based user authentication. In this video I will be breaking down exactly how to set up authentication with JWT and how to ensure the authentication is secure. I will also be showing how to setup refresh tokens with JWT so that your application is even more resilient and secure. Lastly, I will show how to invalidate refresh tokens which is the ultimate last step in securing an application. 📚 Materials/References: User Authentication Video: youtu.be/Ud5xKCYQTjM JWT Explained Video: youtu.be/7Q17ubqLfaM GitHub Code: github.com/WebDevSimplified/JWT-Authentication 🧠 Concepts Covered: - Creating Node.js authentication middleware - Using refresh tokens with JWT - Authenticating users with JWT - Invalidating refresh tokens to log users out - How to use JWT securely 🌎 Find Me Here: My Courses: courses.webdevsimplified.com Patreon: patreon.com/WebDevSimplified Twitter: twitter.com/DevSimplified Discord: discord.gg/7StTjnR GitHub: github.com/WebDevSimplified CodePen: codepen.io/WebDevSimplified #JWT #WDS #Authentication

Why it's here

3 people recommend this

What people say. Highly recommended by developers as a simple and clear guide for implementing JWT authentication in Node.js.

u/im_shashikanthin r/node • Recommends

On “Need help in implementing JWT authentication”

Instead of using passport just use jsonwebtoken module which is very simple to implement and has a lot less code. You can follow this guide. Store the token in a cookie and set the httpOnly flag to true on login. Normally you would want to store the user id as the payload while signing the token. On subsequent requests the cookie will automatically be sent back to the server which you can then parse and verify for validity, grab the user id and serve the request accordingly. Hope this helps

u/aholland909in r/node • Recommends

On “Best way to call authorization function for every route”

link to this video or link to this video should help you out!

u/Feuerhamsterin r/node • Recommends

On “Code for JWT auth?”

link to this video