SSO Connection-based Role Assignments
Assign roles to your Members implicitly based on their specific SSO Connection by passingrole_ids to connection_implicit_role_assignments.
For example, if you want to assign the admin role to anyone who authenticates via the SSO connection, you can pass the following connection_implicit_role_assignments argument:
SSO Connection IdP Group-based Role Assignments
Assign roles to your Members implicitly based on their SSO Connection IdP Groups by passingrole_id and group pairs to group_implicit_role_assignments.
For example, if you want to assign the admin role to anyone in the engineering group, you can pass the following group_implicit_role_assignments argument:
groups key to the SAML connection’s attribute_mapping. The IdP should be configured to send a list of strings under that key.
For example, if your Stytch SAML connection has the following attribute mapping:
group_implicit_role_assignments and their membership in the Engineering group, the Member will be assigned the admin role.
Interactions between Implicit and Explicit Role Assignments
Because implicit role assignments are based on the Member’s login method, RBAC authorization checks are based on the roles for a Member’s Session, rather than the Member definition. This means that a Member’s roles may vary, depending on the login method for that Session. If an explicitly assigned Role is removed from a Member, and the Member is also implicitly assigned that Role from an SSO connection or an SSO group, we will by default revoke any existing Sessions for the Member that contain any SSO authentication factors with the affected connection ID. For example, consider a Member with the following Roles:editor role comes from two sources: an explicit role assignment and an SSO connection implicit role assignment.
Now consider the following Member Session, which contains a SAML SSO authentication factor:
editor explicit role assignment, we will revoke the Member Session with the SAML SSO factor.
If you do not want any Sessions to be revoked when updating a Member’s explicit role assignments, you can pass the preserve_existing_sessions argument with a value of true to the following endpoints: