I have implemented an API endpoint to delete an entity tied to a group in the Auth0 Autorization world.
Here is the workflow:
- List all group members
- Remove all group members from group (1 call with list of user ids)
- For each user
a. execute autorization policy (https://auth0.com/docs/api/authorization-extension#execute-authorization-policy)
b. update the user metadata with the authorization policy (through the management API)
- Remove group from parent group
- Delete group
For a group with a single user, the whole flow takes close to 8 seconds, which I don’t think is really acceptable.
Could someone let me know why the authorization API is so slow, and it response time can be improved, how to do so?