How to Automatically Remove Other Roles When Assigning the "Superadmin" Role in Auth0

I am currently using Auth0 to manage roles for my application, including admin, user, and superadmin. I would like to implement a functionality where if an account is assigned the superadmin role, all other roles (admin, user) are automatically removed.

Is it possible to achieve this directly within Auth0? If so, what would be the best approach to configure this behavior?

Hey there @qStanL welcome to the community!

Are you currently assigning roles in the dashboard or is this automated somehow? I’m not sure this is possible if you are manually assigning roles, but a solution should definitely be possible using Actions and or the Management API in some other way.

1 Like

It is automated by java and management api. For now, I’m not found a way to resolve my issue from auth0’s actions and at the moment I do this inside java

Anyway, thx for your reply.

1 Like

Gotcha, thanks for sharing! I think utilizing the Management API from your Java code is the best route.

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