Learn how to authorize user roles and permissions in this Node.js & Express authorization tutorial. We'll start by learning the difference between authentication and authorization. Then we'll build middleware for our REST API that authorizes specific roles for data endpoint access.

(00:00) Intro
(00:05) Welcome
(00:15) Authentication vs Authorization
(01:44) Configure the User Roles
(02:53) Add roles to the user data model
(04:59) Add a user role at registration
(06:01) Add user roles to access token at authentication
(09:09) Add user roles to access token when refreshed
(10:28) Update the verifyJWT middleware to include roles
(13:18) Create the verifyRoles middleware
(19:19) Add the verifyRoles middleware to routes
(22:04) Test routes with Thunder Client
(27:14) A quick note on Thunder Client

🔗 Starter Source Code: https://github.com/gitdagray/express_jwt 

🔗 Completed Source Code: https://github.com/gitdagray/express_user_roles 

Subscribe: https://www.youtube.com/@DaveGrayTeachesCode/featured 

 #authorization #nodejs #javascript  

How to Authorize User Roles and Permissions in Node.js & Express
1 Likes48.95 GEEK