Unassign all the roles of user in rules

Hello,

We are B2B company, our customer want to send claims to us with their AD groups, and I need to handle with this information, and unassign all roles of user, and then assign another’s roles to the user according to their AD groups.

But there is no good way to do it. Could you give me a hand?

Hi @juncheng,

Welcome to the Community!

You can do this directly from a rule.

Use this endpoint to get the user’s roles, and this endpoint to remove roles. Then, after you have retrieved your AD groups, add roles with this endpoint.

Hope this helps!