This multistep quickstart guide will walk you through setting up and managing authentication in your Node.js web apps using Auth0. Each step demonstrates how to implement a specific feature of Auth0 and is accompanied by a downloadable sample project showing the complete solution.
Create an Application
Get your credentials (Domain, Client ID, and Client Secret) from the dashboard. The sample is pre-configured with your Default App credentials.
Configure Callback URLs
A callback URL is a URL in your application where Auth0 redirects to after the user has authenticated. You can whitelist callback URLs for your app in the Callback URL field in your Application Settings. If no callback URLs are set, a mismatch error will be displayed when a user logs in.
The sample projects which accompany each of these steps will have the following directory structure:
├── app.js ├── bin │ └── www ├── package.json ├── public │ └── stylesheets │ └── style.css ├── README.md ├── routes │ ├── index.js │ └── ... └── views ├── index.jade └── ...
All the project dependencies are managed by npm and listed in the
package.json file for each of the samples.
Run the following command to install the required packages.
Auth0's Lock widget and
auth0.js library are used throughout these quickstarts. These scripts can be obtained from the following CDN links:
Running the Sample Applications
After installing the dependencies for each of the samples, start the application:
With everything set, the app will be available at