| title | Node.JS API Tutorial | ||||||
|---|---|---|---|---|---|---|---|
| name | Node.js API | ||||||
| thirdParty | false | ||||||
| alias |
|
||||||
| languages |
|
||||||
| image | //auth0.com/lib/platforms-collection/img/node.png | ||||||
| tags |
|
||||||
| snippets |
|
<%= include('../_includes/package', { pkgRepo: 'node-auth0', pkgBranch: 'master', pkgPath: 'examples/nodejs-api', pkgFilePath: null, pkgType: 'server' + account.clientParam }) %>
Otherwise, Please follow the steps below to configure your existing NodeJS app to use it with Auth0.
You need to add the express-jwt dependency.
Just run the following code to install the dependency and add it to your package.json
${snippet(meta.snippets.dependencies)}
You need to set the ClientID and ClientSecret in express-jwt's configuration so that it can validate and sign JWTs for you.
${snippet(meta.snippets.setup)}
Now, you need to specify one or more routes or paths that you want to protect, so that only users with the correct JWT will be able to do the request.
${snippet(meta.snippets.use)}
Now you have both your FrontEnd and Backend configured to use Auth0. Congrats, you're awesome!