Configuring Enterprise SSO and SCIM Directory Sync
Manual invitation tracking across large engineering and marketing organizations increases access sprawl and onboarding latency. This guide configures SAML 2.0 / OIDC Single Sign-On (SSO) and enables automated SCIM 2.0 user and group synchronization through Okta, Microsoft Entra ID, or Google Workspace.
Prerequisites
- Workspace permissions:
Ownerrole on a Shaf Enterprise plan. - Administrative access to your corporate Identity Provider (Okta, Microsoft Entra ID, Google Cloud Identity).
- Access to your corporate apex domain’s DNS zone to create a verification TXT record.
Implementation Recipe
Verify Corporate Domain Ownership
In the Shaf Dashboard, navigate to Settings → Enterprise SSO → Domains and add your corporate email domain (e.g.,
acme.com).Add the generated verification TXT record at your domain’s DNS apex:
Type Host Value TTL TXT@(apex)shaf-domain-verification=shaf_txt_8f492b0c3d9a71e5300Click Verify Domain or trigger verification via API:
curl -X POST "https://shaf.app/api/v1/sso/domains/dom_acme_corp/verify" \ -H "Authorization: Bearer $SHAF_API_TOKEN"Configure SAML 2.0 / OIDC Single Sign-On
In your Identity Provider (Okta or Entra ID), create a new SAML 2.0 Enterprise Application:
SAML Attribute Value Single Sign-On (ACS) URL https://dash.shaf.app/api/auth/sso/callbackAudience URI (Entity ID) https://shaf.appName ID Format EmailAddress(urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress)Attribute Statements email→user.email,firstName→user.firstName,lastName→user.lastNameUpload your IdP metadata XML or paste your SSO Sign-In URL and X.509 certificate into Shaf’s SSO configuration panel.
Enable SCIM 2.0 User Provisioning
Automate employee onboarding and de-provisioning using SCIM (see SCIM API Reference for endpoint specifications):
- In Shaf, click Generate SCIM Credentials to issue a long-lived SCIM token (
scim_tok_...). - In your IdP’s Provisioning settings, set the SCIM Base URL:
https://shaf.app/api/v1/scim/v2 - Enter the Bearer token in the SCIM Authorization field.
- Enable Create Users, Update User Attributes, and Deactivate Users.
- Assign relevant IdP groups to push to Shaf.
- In Shaf, click Generate SCIM Credentials to issue a long-lived SCIM token (
Verification
Validate SSO redirection and query the SCIM directory endpoint:
-
Initiate an SP-initiated corporate login in an incognito browser:
https://dash.shaf.app/login?domain=acme.comExpected behavior: Shaf identifies
acme.com, redirects to your corporate IdP login screen, challenges for credentials and MFA, and returns to the Shaf dashboard with an authenticated session. -
Query the SCIM directory using cURL:
curl -X GET "https://shaf.app/api/v1/scim/v2/Users?filter=userName%20eq%20%22alice@acme.com%22" \ -H "Authorization: Bearer $SCIM_TOKEN"Expected response (
200 OK):{ "schemas": ["urn:ietf:params:scim:api:messages:2.0:ListResponse"], "totalResults": 1, "Resources": [ { "id": "usr_01j8k9x2m4", "userName": "alice@acme.com", "active": true, "emails": [{ "value": "alice@acme.com", "primary": true }] } ] }
Common Gotchas
| Issue / Error | Root Cause | Solution |
|---|---|---|
SAML Response: Clock Skew Error |
Time drift between IdP server clock and Cloudflare Anycast edge nodes. | Synchronize IdP server time via Network Time Protocol (NTP). Max allowed drift is 120 seconds. |
401 Unauthorized on SCIM push |
The SCIM bearer token was expired, rotated, or revoked. | Re-generate a SCIM Bearer token in Shaf settings and update your IdP configuration. |
NameID Invalid |
IdP sent an opaque identifier instead of the user’s primary work email. | Update SAML Name ID format to emailAddress in your identity provider application settings. |
| User retains access after IdP removal | SCIM de-provisioning was not toggled in your identity provider. | Ensure the Deactivate Users capability is enabled in Okta or Entra SCIM settings. |