In this tutorial we will show you how to use Auth0 roles with Abstra to enable in app authentication and permissions. We assume you have configured Auth0 credentials in your project (see more here)
Auth0 natively support roles but they don't inject this information by default in the id_token claims.
Create Users and Roles
First check that you have users. In your dashboard go to User Management > Users and check.
Now create your role in User Management > Roles with name and description. Assign the role to a user.
Create Actions to inject the roles
Now you need to create an custom action to inject the role in the id_token claims. Go to Actions > Custom Actions and create a new action. Choose the name and select the trigger as Login / Post Login. Fill the code with