Repository navigation
feat(mcp): Make the iOS app a built-in OAuth client - #3879
Merged
Merged
Conversation
The iOS app's client ID was a raw GitHub URL on a PR branch. When that branch was deleted after merge, the URL returned 404 and every sign-in to a real Junior failed. Junior now knows the app's client (JUNIOR_IOS_CLIENT), so sign-in does not fetch a Client ID Metadata Document. Only this client may redirect to its URL scheme, junior-ios://oauth/callback. The app takes the redirect from ASWebAuthenticationSession and drops its loopback listener. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
1 screenshot change — 1 changed · 0 added · 0 removed Review screenshots in Frameshift
|
armcknight
marked this pull request as ready for review
November 20, 2026 20:42
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0b2a6db. Configure here.
…n-oauth-client Co-Authored-By: andrew <[email protected]>
This comment has been minimized.
This comment has been minimized.
A custom-scheme redirect has the origin "null", so the CSP never allowed junior-ios: and the browser blocked the redirect after Allow. Co-Authored-By: andrew <[email protected]>
armcknight
marked this pull request as draft
November 20, 2026 23:48
armcknight
marked this pull request as ready for review
November 21, 2026 00:20
gricha
approved these changes
Nov 23, 2026
…n-oauth-client Co-Authored-By: andrew <[email protected]>
This branch was successfully 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.

Note: Current test failure is a known flakiness issue: #3914
The implements a real PKCE OAuth flow for the iOS app using the existing custom schema callback. This is technically possible to be cloned by imposter apps; the alternative is to host a
apple-app-site-associationfile on the server identifying legal clients with a regular HTTPS call back URL, but this change does not represent a regression in security posture. We can consider the site association file in a later PR.Slop
Junior now knows the iOS app's OAuth client, so sign-in no longer depends on a hosted Client ID Metadata Document.
The app's
client_idwas a raw GitHub URL on the PR branch of #3544. GitHub deleted that branch after the merge, so the URL returned 404, and every sign-in to a real Junior failed with "The client ID is not a valid client metadata document URL." A raw GitHub URL also proves nothing about who owns the client, because anyone can host a file on that host.The change follows how the Seer Apple apps sign in to Sentry: the server knows the client, and the redirect uses the app's own URL scheme.
JUNIOR_IOS_CLIENTinclient-metadata.tshas the IDhttps://junior.sentry.dev/clients/iosand the redirectjunior-ios://oauth/callback.resolveMcpClientreturns it without a fetch. The ID stays an HTTPS URL, so it passes the existing client ID rules, and the consent page showsjunior.sentry.dev. Nothing is served at that URL, and the app sends this ID, so it must not change.https:or loopbackhttp:, because any app can claim a URL scheme.redirectUriMatchesnow takes the client, so it can apply this rule.ASWebAuthenticationSession, which gives a scheme redirect only to the app that opened the sheet. TheLoopbackReceiverNWListener andoauth-client.jsonare deleted. The mock server also accepts the new redirect.A server that runs an older Junior rejects the new client ID. So the app can sign in to prod only after a release with this change. Prod also needs a release with #2951 (
turnActive), because the app cannot readsearchConversationsresults from 0.310.0.We could also keep a CIMD document at the new URL, so that older servers still accept the app. We did not, because prod is the only known server for the app.
No screenshot test applies: the sign-in screen does not change.
🤖 Generated with Claude Code