Hello. We are implementing impersonation for our e...
# ask-a-descoper
b
Hello. We are implementing impersonation for our end-users by our employees. We have a tenant set up for our employees for SSO with Okta. We have the group mapping configured to associate an Okta Role with a Descope Role for impersonation. The Impersonator role as applied to the SSO user and associated with the tenant. Our end users are not a part of the tenant, and so we cannot impersonate them. I manually added the Impersonator role to an SSO user without the tenant, and then I was able to impersonate an end user. My question is: Is there a way to configure mapping in the SSO group mapping to associate a role in Okta with a role in descope that is at the project level not the tenant scope? It works when it's configured like in the screenshot below. When there is a value in the tenant field, it does not work.
d
Hi, it cannot be part of the SSO mapping since it is something your customers’ IT Admin define, so they won’t know whether to assign a role at the project or tenant level. There are few options for that: 1. Add custom logic in your flow, after a successful SSO login, check the user’s
idpGroups
or the actual user assigned roles and then grant the “Impersonator” role according to your logic. (If not using flow, you can do that via SDK as well) 2. You can also use the audit webhook and act upon the SSO Login even 3. Mark the “Impersonator” role as default project level role, so users without any roles get it automatically (though this won’t override existing roles)