# The Complete Guide to Node.js User Authentication with Auth0

**URL:** <https://community.auth0.com/t/the-complete-guide-to-node-js-user-authentication-with-auth0/52854>\
**Category:** Blog Discussions\
**Created:** [November 6, 2020, 9:36pm UTC](https://community.auth0.com/t/the-complete-guide-to-node-js-user-authentication-with-auth0/52854 "2020-11-06T21:36:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan-auth0](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@dan-auth0](https://community.auth0.com/u/dan-auth0)\
**Post date:** [November 6, 2020, 9:36pm UTC](https://community.auth0.com/t/the-complete-guide-to-node-js-user-authentication-with-auth0/52854/1 "2020-11-06T21:36:37Z")

</div>

**This tutorial demonstrates how to secure a Node.js web application built with the Express framework by implementing user authentication.** You’ll enhance a starter Node.js project to practice the following security concepts:

- Add user login and logout.
- Retrieve user information.
- Protect application routes.
- Call protected endpoints from an API.

[Read on](https://auth0.com/blog/complete-guide-to-nodejs-express-user-authentication/)

 ![Auth0 Express sample app](https://global.discourse-cdn.com/auth0/original/3X/6/3/637a54a265b83813ee8d73817203a1af43d928a3.png)

---

<div class="post-metadata">

**Author:** ![nathaniel.tagg](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nathaniel.tagg/32/29490_2.png) [@nathaniel.tagg](https://community.auth0.com/u/nathaniel.tagg)\
**Post date:** [May 20, 2021, 4:37pm UTC](https://community.auth0.com/t/the-complete-guide-to-node-js-user-authentication-with-auth0/52854/2 "2021-05-20T16:37:16Z")

</div>

This seems a helpful guide. I’ve been using the auth0-passport interface, and this seems to get at what I want in a cleaner way. Also, it allows using hints for sign-up or log-in, which I like.

However, there’s one thing I figured out with auth0-passport I cannot figure out here. How does my node.js application see what permissions a user has? For example, I have created a role called “creator” and given it a permission called “components:create”. In the Passport scheme, I turned on RBAC in the dashboard, and then decoded the access token in the Passport callback to get at the user permissions; if the “components:create” permission existed in that list, I would allow that user to submit a new component to my database.

However, in this library, I can’t figure out how to get at those user permissions. There are good examples for retrieving user Roles, but not for getting at the actual fine-grained permissions. Swapping back to the Passport code, the permissions are still showing up, but I can’t get at them with this library

I’ve tried writing a Rule or Action to get at permissions and copy them to a custom claim, but I can’t figure out how to get them from within an Action.

Also: what does the session: option actually do? It’s not using an express-session store, although it seems like it’s configured like one. Should I be using it? If not, why not? If so, how do I store my own session state data?

Thanks for any help.
