How to get roles included when calling getUsers endpoint

I’m trying to create a rule that adds a users roles inside it’s object which I would like to have baked in when calling: https://auth0.github.io/node-auth0/module-management.ManagementClient.html#getUsers

Getting a list of users and then calling https://auth0.github.io/node-auth0/module-management.ManagementClient.html#getUserRoles is not optimal since calls are needed to be done.

How do I get the roles inside the return object for the list of users?

I pretty sure you can’t. The core RBAC feature’s data is stored separate from the user profile data… it’s a different API endpoint. So if you are going to query the API directly, it takes two calls.

You can create a rule that adds role data to the user’s ID and / or access tokens, along with profile data.

1 Like

Yep that is correct!

Ok thanks guys! I guess I’ll have to spam your api then heh.

I think we can get that handled! No worries! :smiley:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.