Use the hosted local CIMD document only on loopback origins - #2104
Open
Abhishek-B-R wants to merge 1 commit into
Open
Abhishek-B-R wants to merge 1 commit into
Abhishek-B-R wants to merge 1 commit into
Conversation
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
A local Executor opened through a public HTTPS reverse proxy still sends
https://executor.sh/api/oauth/client-id-metadata/local.jsonas its OAuthclient_id, becauseoauthClientIdMetadataDocumentUrl()picks the hosted local document whenever a hosted base URL is configured. That document only lists loopback callbacks, while theredirect_uriis built from the public origin, so providers that support Client ID Metadata Documents (Linear's MCP server, for example) reject the request with "Invalid redirect URI".This uses the hosted local document only when the page is on a loopback origin (
localhost,127.0.0.1or[::1]), or outside the browser as before. On any other origin it falls through to the existing current origin path, so the document it points at advertises the same callback the flow sends.Linked issue
Closes #2073
Verification
Added two cases to
packages/react/src/plugins/oauth-sign-in.test.ts:local.jsondefault.jsonThe reverse proxy case fails on
mainand passes here.oxfmt --checkon the changed files: cleanoxlint -c .oxlintrc.jsonc --deny-warningson the changed files andbun run lint:changelog-stubs: cleantsgo --noEmitinpackages/react: exit 0vitest runinpackages/react: 455 passed (50 files)Checklist
bun run changeset), or this change needs none.