Installation:
> git clone https://gist.github.com/saltukalakus/380a8114e5ce1b0259fef00ecc4b1f5e demo-app
> cd demo-app
> npm install
Setup:
- Create a regular web app in the Auth0 dashboard.
- Add http://localhost:3000/callback as Allowed Callback URL on this application.
- Use the sample rule.js as one of your rules in the Auth0 dashbaord. This rule will merge the user's roles as a custom claim.
- Modify the .env file according to your Auth0 tenant configuration.
- Add three roles named admin, sales, payroll in the roles section in the Auth0 dashbaord.
- Assign a few users to these roles for testing purpose. A user may have one or more of these roles.
Testing:
Run the node.js express server.
> npm start
On a browser open http://localhost:3000