René's URL Explorer Experiment


Title: fix(auth): scope SSO account linking to the verified domain and fence plugin provider mutations by waleedlatif1 · Pull Request #6738 · simstudioai/sim · GitHub

Open Graph Title: fix(auth): scope SSO account linking to the verified domain and fence plugin provider mutations by waleedlatif1 · Pull Request #6738 · simstudioai/sim

X Title: fix(auth): scope SSO account linking to the verified domain and fence plugin provider mutations by waleedlatif1 · Pull Request #6738 · simstudioai/sim

Description: Summary Set trustEmailVerified: false on the SSO plugin. Better Auth's link gate is !isTrustedProvider && !userInfo.emailVerified, so a truthy IdP email_verified claim substituted for the domain binding entirely — any principal able to register a provider could point it at an IdP they control, assert an unrelated address as verified, and auto-link into that account. Linking now requires isTrustedProvider, which is domainVerified plus validateEmailDomain(email, provider.domain), so a provider can only claim identities inside the domain it proved. Fence off the SSO endpoints the plugin serves directly through the auth catch-all. sso/update-provider was gated only on provider ownership and merged the caller's samlConfig, letting an owner restore the mapping.emailVerified the register contract omits — a field the plugin's identity-boundary guard doesn't inspect, so it never tripped the linked-account conflict. sso/delete-provider and the DNS-challenge endpoints were likewise reachable. Deny-by-default under sso/, allowing only the sso/saml2/ protocol paths the IdP posts to, mirroring the existing organization fence. The two guards are layered, not redundant: provider configuration stays owned by /api/auth/sso/register, which is the only path that proves domain ownership. The option only ever set emailVerified on the local row; it was never what made linking work, since Entra omits the claim and SAML ignores it without a mapping the register contract does not accept. domainVerification was already the sole linking trust source, which is what trustProviderByName: false assumes. Behavior change worth noting for self-hosted: a first-time SSO sign-in by a user who already has a local account and whose email domain does not match the provider's registered domain is now rejected as "account not linked". New users are unaffected — the gate only runs when a matching local user exists. Domain matching accepts subdomains; a deployment with multiple email domains needs one provider per domain. Type of Change Bug fix Testing Added regression tests for both fixes, each verified to fail when its fix is reverted: the catch-all guard (blocked mutations, allowed SAML protocol paths, sign-in untouched) and the SSO trust config. Full auth/org/billing suites pass (1768 tests, 154 files), all 27 CI audits pass, tsc --noEmit clean. Router path matching confirmed case-sensitive, so the deny-by-default prefix has no bypass. 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 Set trustEmailVerified: false on the SSO plugin. Better Auth's link gate is !isTrustedProvider && !userInfo.emailVerified, so a truthy IdP email_verified claim substituted for ...

X Description: Summary Set trustEmailVerified: false on the SSO plugin. Better Auth's link gate is !isTrustedProvider && !userInfo.emailVerified, so a truthy IdP email_verified claim subs...

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

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:6acb5032-86a8-9ac0-e131-de1a8a97f558
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC774:F9DBE:25670:36AB6:6AFB4373
html-safe-noncee5fc8f2a0749592998a89841b9b4f4d7bcf6c589eba6eb34e40af7de2ad56bde
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzc0OkY5REJFOjI1NjcwOjM2QUI2OjZBRkI0MzczIiwidmlzaXRvcl9pZCI6IjMxMjU5MDA2ODA0MDk4NTg5MzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac6c3f423bc97505555628340447d28292490bb23e9ee04e26a6663619aada62d2
hovercard-subject-tagpull_request:4287728304
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/6738/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 Set trustEmailVerified: false on the SSO plugin. Better Auth's link gate is !isTrustedProvider && !userInfo.emailVerified, so a truthy IdP email_verified claim substituted for ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned849b928f455c800985398e7f1b659425adb312a5fa14fba5d9a14e62e9fe5dd
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
releasea6c2f87cbcb6414452377b4967858ed6a66f1109
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/6738/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6738%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%2F6738%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/6738/files
Reloadhttps://github.com/simstudioai/sim/pull/6738/files
Reloadhttps://github.com/simstudioai/sim/pull/6738/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests200 (200)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-plugin-endpoint-shadowinghttps://github.com/simstudioai/sim/tree/fix/sso-plugin-endpoint-shadowing
Conversation 7 https://github.com/simstudioai/sim/pull/6738
Commits 4 https://github.com/simstudioai/sim/pull/6738/commits
Checks 30 https://github.com/simstudioai/sim/pull/6738/checks
Files changed https://github.com/simstudioai/sim/pull/6738/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6738/files
fix(auth): scope SSO account linking to the verified domain and fence plugin provider mutations https://github.com/simstudioai/sim/pull/6738/files#top
Show all changes 4 commits https://github.com/simstudioai/sim/pull/6738/files
6acd34a fix(auth): fence off plugin-served SSO provider mutation endpoints waleedlatif1 Aug 15, 2026 https://github.com/simstudioai/sim/pull/6738/commits/6acd34a56b330689af6752abd0b9edc1f09defc2
aea0d54 fix(auth): stop trusting IdP email_verified for SSO account linking waleedlatif1 Aug 15, 2026 https://github.com/simstudioai/sim/pull/6738/commits/aea0d54eafdb4c9c34d03c39a465c94bd0399ea8
76b03b0 docs(auth): note that the SSO fence and trustEmailVerified are layered waleedlatif1 Aug 15, 2026 https://github.com/simstudioai/sim/pull/6738/commits/76b03b01b781484bf12dd1503309e36c6b79ff68
350d26a test(auth): drop unnecessary any casts from the auth catch-all tests waleedlatif1 Aug 15, 2026 https://github.com/simstudioai/sim/pull/6738/commits/350d26acf77d38bbab58a97903c25989864d63fb
Clear filters https://github.com/simstudioai/sim/pull/6738/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6738/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6738/files
route.test.ts https://github.com/simstudioai/sim/pull/6738/files#diff-0153db7cd9696f9ed9d02a1d885a04c4a0cd5a3e39e8e35fef1f56f7281c558f
route.ts https://github.com/simstudioai/sim/pull/6738/files#diff-037cbd57c42c37ad7e3ba0a75a01769fe7cd86ae2fa8e0b0a9b58e711681eb27
auth.ts https://github.com/simstudioai/sim/pull/6738/files#diff-1196450729bfda994f3823921eacd28e3200408dbb562d8481108db9abe4a0e2
sso-trust.test.ts https://github.com/simstudioai/sim/pull/6738/files#diff-3a1f29a89552f6b4b74411c41e20d6a36fe13c7366523270bc96a56bc04950ef
apps/sim/app/api/auth/[...all]/route.test.tshttps://github.com/simstudioai/sim/pull/6738/files#diff-0153db7cd9696f9ed9d02a1d885a04c4a0cd5a3e39e8e35fef1f56f7281c558f
View file https://github.com/simstudioai/sim/blob/350d26acf77d38bbab58a97903c25989864d63fb/apps/sim/app/api/auth/%5B...all%5D/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6738/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6738/files#diff-0153db7cd9696f9ed9d02a1d885a04c4a0cd5a3e39e8e35fef1f56f7281c558f
https://github.com/simstudioai/sim/pull/6738/files#diff-0153db7cd9696f9ed9d02a1d885a04c4a0cd5a3e39e8e35fef1f56f7281c558f
https://github.com/simstudioai/sim/pull/6738/files#diff-0153db7cd9696f9ed9d02a1d885a04c4a0cd5a3e39e8e35fef1f56f7281c558f
https://github.com/simstudioai/sim/pull/6738/files#diff-0153db7cd9696f9ed9d02a1d885a04c4a0cd5a3e39e8e35fef1f56f7281c558f
https://github.com/simstudioai/sim/pull/6738/files#diff-0153db7cd9696f9ed9d02a1d885a04c4a0cd5a3e39e8e35fef1f56f7281c558f
https://github.com/simstudioai/sim/pull/6738/files#diff-0153db7cd9696f9ed9d02a1d885a04c4a0cd5a3e39e8e35fef1f56f7281c558f
Please reload this pagehttps://github.com/simstudioai/sim/pull/6738/files
apps/sim/app/api/auth/[...all]/route.tshttps://github.com/simstudioai/sim/pull/6738/files#diff-037cbd57c42c37ad7e3ba0a75a01769fe7cd86ae2fa8e0b0a9b58e711681eb27
View file https://github.com/simstudioai/sim/blob/350d26acf77d38bbab58a97903c25989864d63fb/apps/sim/app/api/auth/%5B...all%5D/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6738/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6738/files#diff-037cbd57c42c37ad7e3ba0a75a01769fe7cd86ae2fa8e0b0a9b58e711681eb27
https://github.com/simstudioai/sim/pull/6738/files#diff-037cbd57c42c37ad7e3ba0a75a01769fe7cd86ae2fa8e0b0a9b58e711681eb27
https://github.com/simstudioai/sim/pull/6738/files#diff-037cbd57c42c37ad7e3ba0a75a01769fe7cd86ae2fa8e0b0a9b58e711681eb27
apps/sim/lib/auth/auth.tshttps://github.com/simstudioai/sim/pull/6738/files#diff-1196450729bfda994f3823921eacd28e3200408dbb562d8481108db9abe4a0e2
View file https://github.com/simstudioai/sim/blob/350d26acf77d38bbab58a97903c25989864d63fb/apps/sim/lib/auth/auth.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6738/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6738/files#diff-1196450729bfda994f3823921eacd28e3200408dbb562d8481108db9abe4a0e2
https://github.com/simstudioai/sim/pull/6738/files#diff-1196450729bfda994f3823921eacd28e3200408dbb562d8481108db9abe4a0e2
https://github.com/simstudioai/sim/pull/6738/files#diff-1196450729bfda994f3823921eacd28e3200408dbb562d8481108db9abe4a0e2
apps/sim/lib/auth/sso-trust.test.tshttps://github.com/simstudioai/sim/pull/6738/files#diff-3a1f29a89552f6b4b74411c41e20d6a36fe13c7366523270bc96a56bc04950ef
View file https://github.com/simstudioai/sim/blob/350d26acf77d38bbab58a97903c25989864d63fb/apps/sim/lib/auth/sso-trust.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6738/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/6738/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.