Need to add Authentication to an existing Node.js/Express web application? In this video, we’ll install the basic JavaScript dependencies, configure your Express app to handle authentication, update a request handler, and modify the EJS template to display a basic user profile.

In this episode’s bonus tip, we’ll be looking at how to avoid the frustrating job of restarting Node.js every time we make changes to the source files. Stick around to the end for that.

And if you don’t have your Node.js/Express app going already, check out the previous episode, which will help you do just that!

Relevant Links

Generate random data in VS Code -

If you’re facing the cookie issues I mentioned at 8:10, you might need to get your local development environment running over HTTPS. Find out more here:

Video Timecodes

  • 0:00 Hello!
  • 0:18 Installing dependencies
  • 1:17 Configuring our App in the Auth0 Dashboard
  • 2:15 Integrating the SDK into our Codebase
  • 2:57 Defining Environment Variables in Development
  • 4:53 Using the OIDC object in Route Handlers
  • 6:03 Using the Login and Logout Routes
  • 7:00 Conditionally Hiding Unnecessary Route Links
  • 8:10 Note on Cookie Woes in Development Environments
  • 9:12 Outputting the User object in the EJS View
  • 10:38 Generating a User Profile Card
  • 11:53 BONUS TIP! Autorestarting Node
  • 12:45 Teaser for the next episode!

#node #express #auth0

Add Authentication to Existing Node.js/Express Apps with Auth0 - Express and Authentication Series
8.75 GEEK