Model
Mapping
group --connection--> connection tuple (which connection owns this group) and the group#member --member--> connection tuple that grants every group member connection membership. A Check for a group member on the connection can resolve true; a user with no synced group membership has no connection membership from this mapping.
Direct connection memberships
Auth0’suser.created and user.updated event schema does not require context.connection, so a rule that depends on it can miss direct grants. A direct grant must also be removed when a user is deleted or their identities change. This example intentionally does not emit direct-user connection tuples.
If your application needs to grant access to users without SCIM groups, give those memberships their own relation, direct_member, and include it in member. The mapping below reconciles and deletes only direct_member, so it never touches the group-derived membership:
data.object.identities[].connection holds the connection’s name, not the connection ID that group.created uses, so map each name to its ID explicitly and ignore identities on connections you do not list. The mapping reconciles a user’s direct memberships on every user.created and user.updated, so a removed identity also loses its membership, and clears them on user.deleted:
The connection names appear in several places: both
when expressions, the iterator source, and the name-to-ID map. When you add or rename a connection, change every one of them. If they disagree, the event fails: a name missing from the second rule’s list raises a write/delete conflict, and a name missing from the map fails to evaluate.context.connection. Reserve direct_member for this mapping: the filters match every user --direct_member--> connection tuple for the user, so any other writer to that relation would have its tuples removed. See Backfilling and reconciling for loading existing users.
Known limitations
- Connection changes and deletion. This group mapping handles
group.createdandgroup.deleted, but does not reconcile a group moved between connections or clean up all group grants onconnection.deleted. Reconcile mapping-owned group tuples if either occurs; do not delete unrelated memberships. - Roles. There’s no per-user role assignment tied to a plain connection. If you need roles here, assign them to the SCIM group itself; see Roles: a group, at the tenant level.