Title: fix(sso): support skipping the OIDC UserInfo endpoint at registration by waleedlatif1 · Pull Request #5386 · simstudioai/sim · GitHub
Open Graph Title: fix(sso): support skipping the OIDC UserInfo endpoint at registration by waleedlatif1 · Pull Request #5386 · simstudioai/sim
X Title: fix(sso): support skipping the OIDC UserInfo endpoint at registration by waleedlatif1 · Pull Request #5386 · simstudioai/sim
Description: Summary Self-hosted Azure AD/Entra ID SSO breaks on better-auth 1.6.x: the OIDC callback now unconditionally prefers the UserInfo endpoint over ID token claims when one is configured, and our registration tooling was auto-populating userInfoEndpoint from OIDC discovery on every registration. Azure's Graph UserInfo endpoint doesn't reliably return email for all tenants, so login fails with missing_user_info. Adds SSO_OIDC_SKIP_USERINFO_ENDPOINT to register-sso-provider.ts and a matching skipUserInfoEndpoint field on the in-app SSO registration API/contract, so operators can force the plugin onto the ID-token/JWKS verification path instead. The in-app route now passes skipDiscovery: true into better-auth's own registerSSOProvider (since Sim already resolves/validates endpoints itself) instead of relying on better-auth's redundant internal discovery call, which was silently re-populating userInfoEndpoint even when we tried to omit it. Preserves tokenEndpointAuthentication auto-detection from the issuer's discovery document (mirrors better-auth's own selectTokenEndpointAuthMethod) in both the discovery and all-endpoints-explicit paths, with a non-fatal fallback when discovery is unreachable — avoids silently defaulting to client_secret_basic, which has a documented invalid_client failure mode with secrets containing +. Type of Change Bug fix Testing Added 6 new tests to route.test.ts covering skipDiscovery, skipUserInfoEndpoint on/off, discovery-driven tokenEndpointAuthentication selection, and the non-fatal fallback when discovery is unreachable. All 16 tests pass. tsc --noEmit clean on apps/sim and packages/db. bun run check:api-validation passes. Verified against the real @better-auth/sso@1.6.11 source on GitHub (not just our local dist bundle) to confirm the callback claim-precedence logic, overrideUserInfo semantics, and skipDiscovery/discovery-hydration behavior this fix relies on. 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 Self-hosted Azure AD/Entra ID SSO breaks on better-auth 1.6.x: the OIDC callback now unconditionally prefers the UserInfo endpoint over ID token claims when one is configured, and our regi...
X Description: Summary Self-hosted Azure AD/Entra ID SSO breaks on better-auth 1.6.x: the OIDC callback now unconditionally prefers the UserInfo endpoint over ID token claims when one is configured, and our regi...
Opengraph URL: https://github.com/simstudioai/sim/pull/5386
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,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-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:168466a5-eeea-d3aa-044b-633b299a8471 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 88CA:AE1F3:1EFA0F:2B93D3:6AFB5020 |
| html-safe-nonce | 267972d9c9b9f7dc9158c61c51e1a1a90bd8460679c2c19cec4416af5749ce45 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OENBOkFFMUYzOjFFRkEwRjoyQjkzRDM6NkFGQjUwMjAiLCJ2aXNpdG9yX2lkIjoiNzk1MTk4MDkwNDkyODk4OTIxNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2143fe8fd4c59f6c969b34febf758bde607afb1222460e08bbe58db607dc3b2a |
| hovercard-subject-tag | pull_request:3987770628 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5386/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Self-hosted Azure AD/Entra ID SSO breaks on better-auth 1.6.x: the OIDC callback now unconditionally prefers the UserInfo endpoint over ID token claims when one is configured, and our regi... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cbf66c024bb6d10e6955baa7413c54cf13a201bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width