Fix OAuth redirect URI mismatch for org-scoped client-id metadata#1197
Merged
Conversation
Org-scoped client-id metadata documents registered their callback with an executor_org query param on redirect_uri, but the client sends the bare callback and the org is carried in the OAuth state (#1147). Providers that exact-match redirect_uri (PostHog) rejected the authorize request with "Mismatching redirect URI". Org targets keep their distinct client_id URL but now register the same bare callback redirect_uri as every other target.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | 9eb8632 | Commit Preview URL Branch Preview URL |
Jun 28 2026, 11:59 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 9eb8632 | Jun 29 2026, 12:00 AM |
Contributor
Cloudflare previewTorn down — the PR is closed. |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
Merged
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.
When connecting an OAuth integration while an org is active, the authorize request failed at exact-match providers (e.g. PostHog) with:
Cause
The org selector was moved into the OAuth
statein #1147 (the cloud callback reads it back fromstate), but #1148 (the CIMD registry) re-added anexecutor_orgquery param onto theredirect_urisof org-scoped client-id metadata documents. So the two sides disagreed:.../client-id-metadata/<org>.json:https://executor.sh/api/oauth/callback?executor_org=<org>https://executor.sh/api/oauth/callback(bare;oauthCallbackUrl)Providers compare
redirect_urias an exact string, so the extra query param was rejected. Theexecutor_orgparam was also inert: nothing reads it on the callback (org comes fromstate).Fix
Org targets keep their distinct
client_idURL, but all targets now register the same bare callbackredirect_uri, matching what the client sends and the design intent recorded ine2e/cloud/oauth-callback-org-scope.test.ts("the provider state must carry the org selector without adding provider-facing query params to redirect_uri").Removed the now-unused
executor_orgappend (and the orphanedorgSlugFromMetadataTargethelper).Tests
oauth-client-metadata.test.ts: org target now expects a bare callback; a stray legacyexecutor_orgquery param is asserted inert (stays onclient_id, never leaks intoredirect_uri).vitest run(scoped) green,typecheck, scopedlint+format:checkclean.Note: takes effect once executor.sh is deployed (the metadata doc is production-served).