Repository navigation
fix(platform): prefer client_secret_post for OIDC token exchange - #582
Open
kulterryan wants to merge 1 commit into
Open
kulterryan wants to merge 1 commit into
kulterryan wants to merge 1 commit into
Conversation
oauth4webapi form-encodes Basic credentials per RFC 6749 §2.3.1, escaping `-`, `.` and `_`. Google compares them without decoding, so Google client IDs and secrets were rejected at the token endpoint.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Google sign-in through configured login methods fails at the token exchange.
oauth4webapi'sClientSecretBasicform-encodes the client ID and secret before Base64 (RFC 6749 §2.3.1), turning every-,.and_into%2D,%2E,%5F. Google compares the raw values without decoding, so761060634857-….apps.googleusercontent.com/GOCSPX-…never match.Google advertises both methods, and Basic was picked first. Prefer the form body, which providers always decode:
Basic-only providers keep the existing behavior. The legacy
auth/google.tspath already posts credentials in the body and is unaffected.Evidence
New unit test: Google connection, client ID
761060634857-abc_def.apps.googleusercontent.com, discovery listing['client_secret_post', 'client_secret_basic']. Expects the rawclient_idin the token request body and noAuthorizationheader.platform-oidc.test.ts: 1 failed | 24 passedplatform-oidc.test.ts: 25 passedplatform-loginandplatform-bootstrapintegration tests: 42 passed. The 2 browser cases didn't run locally because Playwright's Chromium isn't installed.@voidcloud/apitypecheck passes.Merge Danger
Door: two-way
Blast Radius: OIDC login
Providers that advertise both methods now receive
client_secret_postinstead of Basic. Both are standard and advertised by the provider itself.