René's URL Explorer Experiment


Title: feat(sso): let an organization keep several identity providers on one domain and choose the primary by waleedlatif1 · Pull Request #7836 · simstudioai/sim · GitHub

Open Graph Title: feat(sso): let an organization keep several identity providers on one domain and choose the primary by waleedlatif1 · Pull Request #7836 · simstudioai/sim

X Title: feat(sso): let an organization keep several identity providers on one domain and choose the primary by waleedlatif1 · Pull Request #7836 · simstudioai/sim

Description: Summary An organization can add a second identity provider on a domain it already signs in through, instead of getting "already signs in through the provider…". This is how teams move from one IdP to another (e.g. Entra ID → Okta) without downtime New nullable sso_domain.primary_provider_id names the provider sign-in uses. When it's null, behavior is unchanged: the first verified provider by id, so existing orgs see no difference The name is only honored while that provider still belongs to the org, is verified, and serves the domain. Deleting a provider (settings or deregister script) clears it A provider joining a domain can't take over by sorting first. Unless the domain's named primary still signs it in, the provider already signing people in is named. This applies to new providers, providers moved onto the domain, and untrusted providers saved again, in both the register route and the self-host script A caller's own personal (org-less) provider on the domain still blocks adding an org provider there, same as before Make primary goes through an organization.sso.set_primary_provider application use case (org admin, session) and writes an organization.sso.primary_provider_changed audit entry Settings: a Primary tag shows when a domain has more than one provider, plus Make primary with a confirmation, and a Test sign-in link (/sso?provider=) for a verified provider waiting beside the primary. Grouping uses the normalized domain Resolve honors the test link only for a verified provider that serves the email's domain. A failed test sign-in returns to the same link Delete confirmation names who signs in afterward. Otherwise it keeps the existing "can no longer sign in through it" copy Shared rules (domain key, join, keep-sign-in, clear) live in @sim/db/sso-primary-provider, so the app and scripts can't drift Migration 0347 adds the column and drops sso_provider_org_domain_unique concurrently. The deployed release still refuses same-domain providers before writing, so it's safe during cutover. After a rollback, a domain whose chosen primary doesn't sort first falls back to the first provider by id Docs: new "Switching identity providers" section Type of Change New feature Testing PostgreSQL integration suite covers: resolve, the list route, make primary (roles, cross-org, audit) and delete domain moves, test links, registration pinning, stale names and personal-provider refusal it runs in the CI Postgres job Key cases fail with their fix reverted All 347 migrations applied to an empty database Ran both self-host scripts end to end against a local database, and checked the settings UI in a browser against a running app (two providers, single provider, unverified provider) Unit tests updated. The full vitest suite passes except the pre-existing cleanup-table-row-ttl integration test, which needs a DB lint, check:audits, check:api-validation:strict, docs-manifest:check, repo-wide type-check and check:migrations origin/staging pass Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary An organization can add a second identity provider on a domain it already signs in through, instead of getting "already signs in through the provider…". This is how teams move fr...

X Description: Summary An organization can add a second identity provider on a domain it already signs in through, instead of getting "already signs in through the provider…". This is how teams...

Opengraph URL: https://github.com/simstudioai/sim/pull/7836

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:4506bb0b-205f-ad76-cd6c-6f4827ebfc9f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE196:1C135C:35793:48DEB:6AFB64CB
html-safe-nonce38fa8d8566fbc611749b967fc467c12b258f5f0dbe8d57bf7556ce6fb22d0249
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTk2OjFDMTM1QzozNTc5Mzo0OERFQjo2QUZCNjRDQiIsInZpc2l0b3JfaWQiOiI4OTI4Mjc0NjUzMDEwNTg3NjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac5435c54621a305f8ecbfe561d26d71be8a4da8f0e2e1f16c1860dabb228eb660
hovercard-subject-tagpull_request:4532219503
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/7836/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary An organization can add a second identity provider on a domain it already signs in through, instead of getting "already signs in through the provider…". This is how teams move fr...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release59ef97164c52cf59bd10558ddec9c4f482763988
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/7836/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F7836%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F7836%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/7836/files
Reloadhttps://github.com/simstudioai/sim/pull/7836/files
Reloadhttps://github.com/simstudioai/sim/pull/7836/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
fix/sso-same-domain-providershttps://github.com/simstudioai/sim/tree/fix/sso-same-domain-providers
Conversation 7 https://github.com/simstudioai/sim/pull/7836
Commits 4 https://github.com/simstudioai/sim/pull/7836/commits
Checks 33 https://github.com/simstudioai/sim/pull/7836/checks
Files changed https://github.com/simstudioai/sim/pull/7836/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7836/files
feat(sso): let an organization keep several identity providers on one domain and choose the primary https://github.com/simstudioai/sim/pull/7836/files#top
Show all changes 4 commits https://github.com/simstudioai/sim/pull/7836/files
d4dafff feat(sso): let an organization keep several identity providers on one… waleedlatif1 Sep 15, 2026 https://github.com/simstudioai/sim/pull/7836/commits/d4dafff31ae2ff38e735f78fb65820a2396df2a0
f0f8019 chore(db): remove the SSO primary provider migration ahead of merging… waleedlatif1 Sep 15, 2026 https://github.com/simstudioai/sim/pull/7836/commits/f0f80190c03dd7df01ec52d374c972539229e966
fe2f144 Merge remote-tracking branch 'origin/staging' into fix/sso-same-domai… waleedlatif1 Sep 15, 2026 https://github.com/simstudioai/sim/pull/7836/commits/fe2f1443c35d200f24d033880bf851541b62dd7f
d4405cb fix(sso): regenerate the primary provider migration after staging, an… waleedlatif1 Sep 15, 2026 https://github.com/simstudioai/sim/pull/7836/commits/d4405cbc42d8db0abdac7bacff101b2bca70a1e0
Clear filters https://github.com/simstudioai/sim/pull/7836/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7836/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7836/files
test-build.yml https://github.com/simstudioai/sim/pull/7836/files#diff-a583f7935a5f3192471a2999cbf059eadc857228b5be2c7247f481b799949f8d
sso.mdx https://github.com/simstudioai/sim/pull/7836/files#diff-83392d4a8342c1e09b1355344747456fbb0472e0cb88375edcafd053a2ade97b
route.test.ts https://github.com/simstudioai/sim/pull/7836/files#diff-cf67fe5acbe9bd7b41345df9e14f057670b5bb59d5d33bedf9b11d45a6215ed2
route.ts https://github.com/simstudioai/sim/pull/7836/files#diff-94520db260c099f2d173a32be03804ce8933c7f4ab9d12f058f72e08ea7a00a7
route.ts https://github.com/simstudioai/sim/pull/7836/files#diff-0a6047704ce756d89c3c31872188f03a21b235ae94333fb60a47acc2616088fb
route.test.ts https://github.com/simstudioai/sim/pull/7836/files#diff-602d449104f41ae830209c664a5903824479c317da461304f5980b61630df01e
route.ts https://github.com/simstudioai/sim/pull/7836/files#diff-9c7c8c68e412f03f38ccb4dc51f2ab7a802d67c6d9c9b6de615e4509aafabe7c
route.test.ts https://github.com/simstudioai/sim/pull/7836/files#diff-51c0966d63b8a8bef2db4c7255a0f4a7685f42ad57bcdeae5d2edde482857fa8
route.ts https://github.com/simstudioai/sim/pull/7836/files#diff-27ab506eb0f7888e4f8d34702ba36d17685bdb252e54c1ca4d395105e5880c38
route.ts https://github.com/simstudioai/sim/pull/7836/files#diff-d6f27b4f6b38db8d74c4c443e9f7d3f1a4f4601d2d6b65ec34fd472f3b1a1741
route.ts https://github.com/simstudioai/sim/pull/7836/files#diff-29df4ea82eab18d3f740874a6993479f27e5d36b9cb3fc1cf08db485f0e3fbb0
sso-form.test.tsx https://github.com/simstudioai/sim/pull/7836/files#diff-5930dec231c4beb2b61bf77994dceda839d88d6813e50568337ca23a517d79bb
sso-form.tsx https://github.com/simstudioai/sim/pull/7836/files#diff-ef5b4087760eadee5edf5370f0d200711694865d34885b9465459674f9b1fffc
sso-provider-list.tsx https://github.com/simstudioai/sim/pull/7836/files#diff-c12e46bb6cd480c63ea1e1f25dd067608185501aabce1df0ae9ea5a16dee116e
sso-provider-settings.tsx https://github.com/simstudioai/sim/pull/7836/files#diff-df125073c6f2c5a57cff1066eae2c906b1d9a02e7aef5ff7b3122d099e9db668
sso-settings.test.tsx https://github.com/simstudioai/sim/pull/7836/files#diff-4b0de14c1c3c4ec81765fa1035c13899c4b1933ea1df456e2b76e0613a52f7ea
sso-settings.tsx https://github.com/simstudioai/sim/pull/7836/files#diff-ab0807277e5cd6d53813e9eb72605df2cf6737dc34e17903c162ff777f228ac9
sso.ts https://github.com/simstudioai/sim/pull/7836/files#diff-ef4d5bd17c55765d206935d0c2da406420e4cbc29b7aaf1836028d4637c2f508
auth.ts https://github.com/simstudioai/sim/pull/7836/files#diff-f496161d88e150d0e693614d553e4f3d1df412175346186ad70b29f88ed8e451
set-primary-provider.test.ts https://github.com/simstudioai/sim/pull/7836/files#diff-ef5f12547da8027319a5f121a905818f6fdf3be07cc764e0aa36226e89ae0994
set-primary-provider.ts https://github.com/simstudioai/sim/pull/7836/files#diff-768ad9d0dad1be1d37c2c838d62566757ce12643a40e86132f2d73d097d75176
primary-provider.postgres.test.ts https://github.com/simstudioai/sim/pull/7836/files#diff-48cd4bac09792abeae76c43a0f13c0daf53569a426a9ece86ca07a0c92e1526e
primary-provider.test.ts https://github.com/simstudioai/sim/pull/7836/files#diff-a31160278eb96fa0476f14bef19466534fcd1d7747eeadd811ce89d192c45f60
primary-provider.ts https://github.com/simstudioai/sim/pull/7836/files#diff-efd77aa293a4353bc443be0b5c81100c4dbbdbec66b7ff57b08130d6df73f3ce
types.ts https://github.com/simstudioai/sim/pull/7836/files#diff-0c4c4527875ffe443d3b9bc35837c1dfb53d8918c2751deafbc08896fd8d5731
0347_sso_domain_primary_provider.sql https://github.com/simstudioai/sim/pull/7836/files#diff-52d4320a8c6d3eadc5e6a82f495ce5aad07984eba1b293f58b38e27ca8abf928
0347_snapshot.json https://github.com/simstudioai/sim/pull/7836/files#diff-1ca3c3656c6269830e525bc90861a8c0c793835aa2fec0f27c4665283fe264ac
_journal.json https://github.com/simstudioai/sim/pull/7836/files#diff-37150cc65ad16ee6fbc5fa318fc096be7730e16d63eaf863e3df5521b7030649
package.json https://github.com/simstudioai/sim/pull/7836/files#diff-c89735ad606b83e822d493ca765a37afb7fcd2e5621f828a2cfc984ed5e67367
schema.ts https://github.com/simstudioai/sim/pull/7836/files#diff-9a959e2ce3cb4c86957bbae021d06eae364f7b0cb18964f5873bab53220af928
deregister-sso-provider.ts https://github.com/simstudioai/sim/pull/7836/files#diff-cdc0f5eb5f7e0722695a056ec6a9d0f4a36efcdce211f2156a92aac6d6fc94cb
register-sso-provider.ts https://github.com/simstudioai/sim/pull/7836/files#diff-49c7d2db2f91dddae11f8d4448d4c47f292652a03e79bdf4e48fc52ce46f07da
sso-primary-provider.ts https://github.com/simstudioai/sim/pull/7836/files#diff-2ea9603ea24428ffe6ae95d8566df60adfb781d1ff80e941fa22dc62eae4205b
audit.mock.ts https://github.com/simstudioai/sim/pull/7836/files#diff-ddbf3f281bccb1e55eb3765c29403087addedc24fb5f99c437c69a9a412c1e91
schema.mock.ts https://github.com/simstudioai/sim/pull/7836/files#diff-3b648ee44a059e5fc069169fdfd7c32c89200a3e79b5d0dc25227d3470da73af
.github/workflows/test-build.ymlhttps://github.com/simstudioai/sim/pull/7836/files#diff-a583f7935a5f3192471a2999cbf059eadc857228b5be2c7247f481b799949f8d
View file https://github.com/simstudioai/sim/blob/d4405cbc42d8db0abdac7bacff101b2bca70a1e0/.github/workflows/test-build.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7836/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7836/files#diff-a583f7935a5f3192471a2999cbf059eadc857228b5be2c7247f481b799949f8d
https://github.com/simstudioai/sim/pull/7836/files#diff-a583f7935a5f3192471a2999cbf059eadc857228b5be2c7247f481b799949f8d
apps/docs/content/docs/platform/enterprise/sso.mdxhttps://github.com/simstudioai/sim/pull/7836/files#diff-83392d4a8342c1e09b1355344747456fbb0472e0cb88375edcafd053a2ade97b
View file https://github.com/simstudioai/sim/blob/d4405cbc42d8db0abdac7bacff101b2bca70a1e0/apps/docs/content/docs/platform/enterprise/sso.mdx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7836/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7836/files#diff-83392d4a8342c1e09b1355344747456fbb0472e0cb88375edcafd053a2ade97b
https://github.com/simstudioai/sim/pull/7836/files#diff-83392d4a8342c1e09b1355344747456fbb0472e0cb88375edcafd053a2ade97b
https://github.com/simstudioai/sim/pull/7836/files#diff-83392d4a8342c1e09b1355344747456fbb0472e0cb88375edcafd053a2ade97b
https://github.com/simstudioai/sim/pull/7836/files#diff-83392d4a8342c1e09b1355344747456fbb0472e0cb88375edcafd053a2ade97b
https://github.com/simstudioai/sim/pull/7836/files#diff-83392d4a8342c1e09b1355344747456fbb0472e0cb88375edcafd053a2ade97b
https://github.com/simstudioai/sim/pull/7836/files#diff-83392d4a8342c1e09b1355344747456fbb0472e0cb88375edcafd053a2ade97b
https://github.com/simstudioai/sim/pull/7836/files#diff-83392d4a8342c1e09b1355344747456fbb0472e0cb88375edcafd053a2ade97b
https://github.com/simstudioai/sim/pull/7836/files#diff-83392d4a8342c1e09b1355344747456fbb0472e0cb88375edcafd053a2ade97b
apps/sim/app/api/auth/sso/providers/[providerId]/route.test.tshttps://github.com/simstudioai/sim/pull/7836/files#diff-cf67fe5acbe9bd7b41345df9e14f057670b5bb59d5d33bedf9b11d45a6215ed2
View file https://github.com/simstudioai/sim/blob/d4405cbc42d8db0abdac7bacff101b2bca70a1e0/apps/sim/app/api/auth/sso/providers/%5BproviderId%5D/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7836/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7836/files#diff-cf67fe5acbe9bd7b41345df9e14f057670b5bb59d5d33bedf9b11d45a6215ed2
https://github.com/simstudioai/sim/pull/7836/files#diff-cf67fe5acbe9bd7b41345df9e14f057670b5bb59d5d33bedf9b11d45a6215ed2
https://github.com/simstudioai/sim/pull/7836/files#diff-cf67fe5acbe9bd7b41345df9e14f057670b5bb59d5d33bedf9b11d45a6215ed2
https://github.com/simstudioai/sim/pull/7836/files#diff-cf67fe5acbe9bd7b41345df9e14f057670b5bb59d5d33bedf9b11d45a6215ed2
Please reload this pagehttps://github.com/simstudioai/sim/pull/7836/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7836/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.