JWT Authentication | Node JS and Express tutorials for Beginners

preview_player
Показать описание


JWT Authentication | Node JS and Express tutorials for Beginners

(00:00) Intro
(00:05) Welcome
(00:21) JWT Authentication
(03:23) Set up
(03:36) Installing new dependencies
(04:29) Creating environment variables
(07:21) Creating JWT tokens at authorization
(18:14) Creating JWT verification middleware
(21:47) Applying JWT token verification to specific routes
(24:53) Applying JWT token verification to many routes
(28:18) Adding cookie-parser middleware
(29:46) Creating a refresh token controller
(36:03) Creating the refresh route
(36:46) Adding the refresh route to the server
(37:37) Testing the refresh route
(40:03) Creating a logout controller
(48:36) Creating the logout route
(49:26) Adding the logout route to the server
(49:43) A Quick Debug
(50:13) Testing the logout route
(52:43) Frontend: fetch needs the credentials option
(53:29) Backend: CORS needs Access-Control-Allow-Credentials
(56:18) Chrome requires specific cookie options

📚 JWT References:

📚 Login References:

📚 More References:

✅ Follow Me:

#jwt #authentication #node
Рекомендации по теме
Комментарии
Автор

So this is how a senior dev works and explains things. Simply amazing. Thank you for these videos.

marcusaureliusregulus
Автор

Dude, this is by far the best tutorial series I have seen. Unparalleled quality. Thankyou!

cqewikq
Автор

I've been following your tutorials on Node, Express, and working my way to Mongo for my project this week. I've told my professor about how helpful your videos are and I've been spreading the word to my classmates. I'm surprised you don't have more views on these tutorials. Thank you for your help!

Alibeee
Автор

I just wanted to say I appreciate you and what you do. Your videos are well explained, very thorough, but also digestible. Some instructors get a bit too technical, or lack enough technicality to fully understand what is happening. Yours are right in the pocket. Thank you, kind sir. You have provided a lot of clarification for me.

stevieholland
Автор

be very careful when testing this specific implementation with nodemon vs a normal server. nodemon restarts after any file changes, including changes to models\users.json. This allows each function to get the updated state of refresh token. If you run this without nodemon, your refresh and logout functions will reference old versions of the users.json data that do not include the refresh token from the auth. This causes some unwanted behavior that took me quite a while to catch. As always, thanks @DaveGrayTeachescode for another great and comprehensive lesson

Uniqlo
Автор

hey dave this series is really helpful. the way you split things into routers and middleware has been eye-opening. so simple

susiebaka
Автор

I usually stay away from tutorials but the content you post is insanely good, I have actually learnt a lot from your channel. Since I discovered it my skills with javascript have improved a lot. Thank you so much

xifrefont
Автор

This is masterpiece! 😍 I've thanked on all videos of you I've watched in the comments, and I will do it again on this one because you deserve it. Please keep creating content, I'm seriously worried you might lose interest in it at some point and we lose more content created by you, because you're so good.

tabliqatchi
Автор

Thank you Dave. I read through all the comments and your responses to the questions asked which adds more to what has been learned in the video. Thanks again.

ogundekoadegbenga
Автор

thanks for putting up these videos dave. hopefully the playlist will be a library for node videos that i can come back to if i need a refresher

cinemarat
Автор

Hi Dave, Thanks again for sharing this high quality content. Your explanations are excellent.

edwilsondasilva
Автор

Thanks Dave, you’re an awesome teacher. Keep it coming please!

shaeebali
Автор

Thanks so much, I just finished your node js course so I was going back to some concepts, I don’t thank you enough

abdulrahmanagboolaosho
Автор

Thank you for nodejs playlist, Your clear explanations and practical examples made the learning process engaging and effective.

wedadgamalelden
Автор

Again great video. Thank you very much Dave.

Автор

This is a very valuable video for me. I've been trying to understand how the aT and rT works. Thanks very much

learner
Автор

dave calling out whitelist was the perfect endcap to this great video. dave, my man, youve done it again... another fantastic video

internet_glen
Автор

Would love to see an updated version with Typescript and maybe with a relational database. These videos are literally the best.

camcodes
Автор

Hi Dave. Thank you very much. This series have helped me so much.

rockfox
Автор

I watched many ttorials about jwt because I worked with fullstack php many years and I dont understand rest api so good and This tutorial is where really I did understan about refreshtoken. Thanks

kakhabervk