Auth0 Home Blog Docs

How to get user's role on server side (API)

rules
nodejs
roles
express

#1

I am setting user roles in Rules.
I wish then to check that the user holds the correct role (admin) in order to allow certain actions.
How can I check that on a node (express.js) API?


#2

If you have stored the roles as part of the user profile data, you can access it by requesting the user profile, or from the id_token of the user.

Here is a quick start for the node.