API Reference
Use the SCIM API endpoints to manage SCIM connections on your backend.
Frontend SDKs
Use the frontend SDKs to manage SCIM connections on your frontend.
SCIM Admin Portal Component
Add drop-in SCIM connection management UI to your application.
How it works
Stytch’s SCIM product handles everything out-of-the-box for you, immediately updating , handling session revocation, and granting/revoking RBAC roles based on actions from the IdP. To keep other systems in sync, use Stytch’s webhooks to trigger updates elsewhere in your application.Example flow
Supported SCIM actions
The follow actions in SCIM are supported, and result in the following updates to the corresponding Stytch Organization and Members:| SCIM action | Stytch updates | RBAC updates | Session updates | Webhook triggered |
|---|---|---|---|---|
| Member provisioned | Creates Member in Organization | Assigns any email domain Implicit Role Grants | scim.member.create | |
| Member info updated | Update Member entity | Revokes or Assigns any email domain Implicit Role Grants | RBAC changes propagated to active JWTs on next refresh <= 5 min | scim.member.update |
| Member deprovisioned | Updates Member.Status to deactivated | Revokes all current Roles | Revokes all current Sessions | scim.member.delete |
| Member reactivated | Updates Member.Status to active | Apply any qualified Implicit Role Grants (Explicit Roles Grants must be re-assigned) | scim.member.update | |
| Group created | Creates a SCIM Group record with a stable UUID | scim.scim_group.create | ||
| Group info updated | Updates SCIM Group’s Display Name (only editable field) | scim.scim_group.update | ||
| Member added to group | Creates record of MemberID belonging to SCIM Group | Applies any SCIM Group Implicit Role Grants | RBAC changes propagated to active JWTs on next refresh <= 5 min | scim.scim_member_group.create |
| Member removed from group | Sets Member’s SCIM Group membership record to deleted | Removes any SCIM Group Implicit Role Grants | RBAC changes propagated to active JWTs on next refresh <= 5 min | scim.scim_member_group.delete |
| Group deleted | Updates SCIM Group and membership records to deleted | Revokes any SCIM Group Implicit Role Grants | RBAC changes propagated to active JWTs on next refresh <= 5 min | scim.scim_group.delete |
Attribute mappings
Stytch requires any identity provider to specify the email and name of the member attempting to log in. It parses these from the attributes sent in the IdP’s assertion to Stytch. To recognize which attributes correspond to which fields, Stytch allows your connection to define anattribute_mapping.
An example attribute_mapping looks like this:
email key to be present to determine the member’s email. If the connection uses the Email Address NameID format, set the email key to NameID to tell Stytch to parse the email from the NameID. If the connection uses an alternative NameID format, set email to the value of the SAML attribute containing the member’s email. Additionally, in order to determine the member’s name, Stytch requires either the full_name key to be present, or both the first_name and last_name keys.
We strongly recommend configuring an
idp_user_id attribute, set to the user’s stable ID in their IdP. This will allow Stytch to find the existing Member in the event of an IdP-driven email change, and log the user into their existing account rather than creating a new Member record.emailfull_namefirst_namelast_namegroupsidp_user_id
Considerations for using SSO Custom Attributes
- Although Trusted Metadata can still be updated directly via the Update Member endpoint, fields driven by the IdP will be overwritten again on subsequent logins.
- Metadata derived from IdP attributes will still exist after the IdP is deleted.
- If an IdP does NOT send a field, or the field is removed from the attribute mapping, Stytch will NOT delete the field from the Trusted Metadata on next login. All fields need to be deleted explicitly via the Update Member endpoint.
member.email: john.doe@example.commember.name: John Doemember.sso_registrations[0].external_id: u_123_examplemember.trusted_metadata.title: Staff Software Engineer
Single sign-on URLs
Some IdPs may ask for a single sign-on URL. This is listed as theacs_url in the SAML connection object. Note that for Stytch’s purposes, the acs_url and audience_uri are the same value.