My goal is to assign an initial role to a user on first login. I want to find the appropriate role’s id so I want to fetch the list of all roles and then get the id of the target role for assignment to the user.
I’m getting the following error when I try to call getRoles: Unhandled rejection APIError: {"statusCode":403,"error":"Forbidden","message":"Insufficient scope, expected any of: read:roles","errorCode":"insufficient_scope"}
var ManagementClient = require('auth0@2.17.0').ManagementClient;
var management = new ManagementClient({
token: auth0.accessToken,
domain: auth0.domain
});
management.getRoles().then(function (roles) {
console.log('roles', roles);
});