Hello! I started using roles, Now i have an issue...
# ask-a-descoper
a
Hello! I started using roles, Now i have an issue where users that login with SSO, don't have a role assigned to them, What would be the best way to implement that? (in my invite flow for example, i added the role to the tenant as part of the user creation) I want the assigned role to be for the specific tenant
m
@Atharva Joshi @Rahul Rijhwani can you help here ?
Basically the Identity Provider of your customers send the users’ groups and attributes on the SAMLResponse (or OIDC), and your customers’ IT Admin will need to define their group to role mapping according to their needs.
So once the user logged in via SSO the roles will be assigned according to the group to roles mapping defined for that customer SSO configuration.
a
I want it to be a single role, without any connection to their SSO role or a mapping
like, for now - everyone is an admin for example
d
so just set default role..
It does make less sense in the SSO world by the way, since IT Admins should decide that, but if you want to have the same role for everyone you can decide what is the default role per project, per tenant or per SSO, or have an action in the flow to set the role to the user according to your own logic.
a
Yes i understand but i don't need that for now. From what i saw, the default role is not assigned to the specific tenant - right?
d
Right, project level roles currently assigned at the tenant level (there is a feature request for that), you can set a default tenant role at the tenant level as well, or you can define it in the SSO Configuration for that tenant.
a
Ok cool that could work! But ideally i don't want to have to change that per tenant (manual work) I think that adding it to the
sign-up-or-in
flow can be nice, but am not sure how to find the tenant and add the role there
d
The tenant is already in the context. So you should just use the assign role action and mark tenant level (after the user already logged in via SSO to the tenant)
You can also add condition in case the role already exists to avoid extra call (not critical)
a
Cool, so i assume this would be a good point to add it?
d
I did not see the entire flow but I think yes
@Rahul Rijhwani please assist
👀 1
r
Above flow is good @Alon Menczer . Is it works or not?
a
Yes, Thanks!
✅ 1