René's URL Explorer Experiment


Title: [BUG] SSO OIDC: client_secret_basic default causes invalid_client when secret contains special characters · Issue #3626 · simstudioai/sim · GitHub

Open Graph Title: [BUG] SSO OIDC: client_secret_basic default causes invalid_client when secret contains special characters · Issue #3626 · simstudioai/sim

X Title: [BUG] SSO OIDC: client_secret_basic default causes invalid_client when secret contains special characters · Issue #3626 · simstudioai/sim

Description: Bug Description When registering an SSO OIDC provider via register-sso-provider.ts, the tokenEndpointAuthentication field is optional with no default value. When unset, better-auth's SSO plugin (index.mjs:595) defaults to client_secret_b...

Open Graph Description: Bug Description When registering an SSO OIDC provider via register-sso-provider.ts, the tokenEndpointAuthentication field is optional with no default value. When unset, better-auth's SSO plugin (in...

X Description: Bug Description When registering an SSO OIDC provider via register-sso-provider.ts, the tokenEndpointAuthentication field is optional with no default value. When unset, better-auth's SSO plugin...

Opengraph URL: https://github.com/simstudioai/sim/issues/3626

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG] SSO OIDC: client_secret_basic default causes invalid_client when secret contains special characters","articleBody":"## Bug Description\n\nWhen registering an SSO OIDC provider via `register-sso-provider.ts`, the `tokenEndpointAuthentication` field is optional with no default value. When unset, better-auth's SSO plugin (`index.mjs:595`) defaults to `client_secret_basic`:\n\n```js\nauthentication: config.tokenEndpointAuthentication === \"client_secret_post\" ? \"post\" : \"basic\"\n```\n\nIn `client_secret_basic` mode, better-auth encodes credentials as `Base64(client_id:client_secret)` **without URL-encoding** the values first, as required by [RFC 6749 §2.3.1](https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1).\n\nThis causes OIDC providers to decode `+` as a space, `=` as a delimiter, etc., resulting in a secret mismatch and `invalid_client` error.\n\n## Steps to Reproduce\n\n1. Register an SSO OIDC provider using `register-sso-provider.ts` without setting `tokenEndpointAuthentication`\n2. Use a client secret that contains `+`, `=`, `/`, or other Base64 special characters\n3. Attempt SSO login\n4. Token exchange fails with `invalid_client`\n\n## Expected Behavior\n\nToken exchange should succeed regardless of special characters in the client secret.\n\n## Root Cause\n\n- `register-sso-provider.ts` passes `tokenEndpointAuthentication` as-is (undefined when not set)\n- `undefined === \"client_secret_post\"` evaluates to `false`, so better-auth uses `\"basic\"`\n- better-auth does not URL-encode credentials before Base64 encoding in `client_secret_basic` mode (violates RFC 6749 §2.3.1)\n\n## Proposed Fix\n\nDefault `tokenEndpointAuthentication` to `'client_secret_post'` in `register-sso-provider.ts` to avoid the upstream encoding issue:\n\n```typescript\ntokenEndpointAuthentication:\n  ssoConfig.oidcConfig.tokenEndpointAuthentication || 'client_secret_post',\n```\n\nThis is a workaround — the root cause is in better-auth's SSO plugin, which should URL-encode credentials per RFC 6749 §2.3.1 when using `client_secret_basic`.\n\n## Environment\n\n- Sim version: v0.5.113 (main branch)\n- better-auth: 1.3.12\n- Affected file: `packages/db/scripts/register-sso-provider.ts`","author":{"url":"https://github.com/minijeong-log","@type":"Person","name":"minijeong-log"},"datePublished":"2026-03-17T09:56:18Z","url":"https://github.com/simstudioai/sim/issues/3626"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:dc59aa72-4a2a-57ee-1c87-74ccd831fe96
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBE1A:34DD79:3C66EB:555E60:6AFB597A
html-safe-nonce79eb1100178f2b5c83c27be72d287a298b723ba672e8e00f9a137002d761eff9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTFBOjM0REQ3OTozQzY2RUI6NTU1RTYwOjZBRkI1OTdBIiwidmlzaXRvcl9pZCI6IjI5NDkzNzY5NzA0OTM0ODMzODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc148042656adc4425c2b28cf5e7735041640293a607df64d475e33e8a1a17ec8
hovercard-subject-tagissue:4087430620
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/simstudioai/sim/3626/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e1fa0fb515227e8154de81f21e3d908737c6b377b473365f6aa45cc2519ec5d7/simstudioai/sim/issues/3626
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e1fa0fb515227e8154de81f21e3d908737c6b377b473365f6aa45cc2519ec5d7/simstudioai/sim/issues/3626
og:image:altBug Description When registering an SSO OIDC provider via register-sso-provider.ts, the tokenEndpointAuthentication field is optional with no default value. When unset, better-auth's SSO plugin (in...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameminijeong-log
hostnamegithub.com
expected-hostnamegithub.com
Noneea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release59ef97164c52cf59bd10558ddec9c4f482763988
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/simstudioai/sim/issues/3626#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fissues%2F3626
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%2Fissues%2F3626
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/issues/3626
Reloadhttps://github.com/simstudioai/sim/issues/3626
Reloadhttps://github.com/simstudioai/sim/issues/3626
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
https://github.com/simstudioai/sim
New issuehttps://github.com/login?return_to=https://github.com/simstudioai/sim/issues/3626
New issuehttps://github.com/login?return_to=https://github.com/simstudioai/sim/issues/3626
[BUG] SSO OIDC: client_secret_basic default causes invalid_client when secret contains special charactershttps://github.com/simstudioai/sim/issues/3626#top
https://github.com/minijeong-log
minijeong-loghttps://github.com/minijeong-log
on Mar 17, 2026https://github.com/simstudioai/sim/issues/3626#issue-4087430620
RFC 6749 §2.3.1https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1
minijeong-loghttps://github.com/minijeong-log
on Mar 17, 2026https://github.com/simstudioai/sim/issues/3626#event-23638765629
fix(sso): default tokenEndpointAuthentication to client_secret_posthttps://github.com/minijeong-log/sim/commit/a24f2718628b6b40024f8c574e329132f4fd3a0d
https://docs.github.com/articles/closing-issues-via-commit-messages
a24f271https://github.com/minijeong-log/sim/commit/a24f2718628b6b40024f8c574e329132f4fd3a0d
fix(sso): default tokenEndpointAuthentication to client_secret_posthttps://github.com/minijeong-log/sim/commit/4ba09f4a68d26b9729bcfe0989e348dc72e5df14
https://docs.github.com/articles/closing-issues-via-commit-messages
4ba09f4https://github.com/minijeong-log/sim/commit/4ba09f4a68d26b9729bcfe0989e348dc72e5df14
waleedlatif1https://github.com/waleedlatif1
on Apr 7, 2026https://github.com/simstudioai/sim/issues/3626#event-24264076651
fix(sso): default tokenEndpointAuthentication to client_secret_post (#…https://github.com/simstudioai/sim/commit/f46886e6cf0636d83e827f9585e6b8392e8830ed
#…https://github.com/simstudioai/sim/pull/3627
https://docs.github.com/articles/closing-issues-via-commit-messages
f46886ehttps://github.com/simstudioai/sim/commit/f46886e6cf0636d83e827f9585e6b8392e8830ed
emir-karabeghttps://github.com/emir-karabeg
on Apr 7, 2026https://github.com/simstudioai/sim/issues/3626#event-24268308898
fix(sso): default tokenEndpointAuthentication to client_secret_post (#…https://github.com/simstudioai/sim/commit/7c963cb772a1bd767fefff69717db7cf8f7217c8
#…https://github.com/simstudioai/sim/pull/3627
https://docs.github.com/articles/closing-issues-via-commit-messages
7c963cbhttps://github.com/simstudioai/sim/commit/7c963cb772a1bd767fefff69717db7cf8f7217c8
waleedlatif1https://github.com/waleedlatif1
completedhttps://github.com/simstudioai/sim/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
f46886ehttps://github.com/simstudioai/sim/commit/f46886e6cf0636d83e827f9585e6b8392e8830ed
on Apr 7, 2026https://github.com/simstudioai/sim/issues/3626#event-24274173850
Sign up for freehttps://github.com/signup?return_to=https://github.com/simstudioai/sim/issues/3626
Sign in to commenthttps://github.com/login?return_to=https://github.com/simstudioai/sim/issues/3626
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.