# How to add enterprise SSO and SCIM to a Better Auth app

DevFeed: [How to add enterprise SSO and SCIM to a Better Auth app](<https://devfeed.tech/articles/how-to-add-enterprise-sso-and-scim-to-a-better-auth-app-109547.md>)

Original publisher: [Read original article](<https://workos.com/blog/add-enterprise-sso-scim-better-auth-app>)

Author: WorkOS

Published: 2026-10-30T00:00:00Z

Content type: tutorial

Language: en

Sources: [WorkOS](<https://devfeed.tech/sources/workos-blog.md>)

Topics: [Single sign-on (SSO)](<https://devfeed.tech/topics/sso.md>), [saml](<https://devfeed.tech/topics/saml.md>), [Integration testing](<https://devfeed.tech/topics/integration-testing.md>), [OpenID connect (OIDC)](<https://devfeed.tech/topics/oidc.md>)

Tags: [app](<https://devfeed.tech/tags/app.md>), [auth](<https://devfeed.tech/tags/auth.md>), [better](<https://devfeed.tech/tags/better.md>), [customers](<https://devfeed.tech/tags/customers.md>), [directory](<https://devfeed.tech/tags/directory.md>), [enterprise](<https://devfeed.tech/tags/enterprise.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [oidc](<https://devfeed.tech/tags/oidc.md>), [saml](<https://devfeed.tech/tags/saml.md>), [sessions](<https://devfeed.tech/tags/sessions.md>), [sso](<https://devfeed.tech/tags/sso.md>)

## AI overview

The guide keeps Better Auth in charge of users, sessions, and existing sign-in methods while WorkOS handles enterprise SAML/OIDC SSO, directory sync, and IT setup. It outlines a flow that routes verified enterprise email domains to SSO, validates state, organization, and domain in the callback, and links identities by organization plus IdP user ID rather than email. Existing users connect SSO while signed in; per-customer enforcement can be enabled after that transition. Directory Sync deactivation events revoke sessions, with idempotent background handling and periodic reconciliation recommended. WorkOS's Admin Portal gives customer admins a self-serve setup path. The approach suits apps where most users remain self-serve, but creates two systems to keep aligned as enterprise needs expand; the guide suggests considering AuthKit if that overhead grows. Examples assume Node.js 20+, Better Auth 1.7.x, TypeScript, and Next.js App Router for webhooks.

## Source excerpt

Keep Better Auth for sign-in and sessions, and let WorkOS handle SAML, OIDC and directory sync for the customers who need them.