Repository navigation
Preserve gateway sign-in state during OAuth redirects - #205
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
What changed
This fixes a reproduced in-app routing case, not a confirmed root cause for the reporter's particular deployment. Sign in with Chrome remains unresolved for this gateway-start scenario: the gateway start must stay in WebView because Chrome has a separate cookie store. A safe handoff after the gateway redirect, including state/PKCE continuity, needs further investigation and live acceptance. Direct Pocket ID WebView passkeys and the separate upstream Dashboard root-route bug remain unresolved.
Pocket ID is a self-hosted passkey-based identity provider; TinyAuth can act as the sign-in gateway. The current TinyAuth source creates the OAuth session cookie when its frontend requests an authorization URL and checks it at the callback; its frontend then navigates to that URL. This PR's redirect fixture is a different possible gateway sequence, not a reproduction of the reporter's exact TinyAuth flow. The Chrome Auth Tab documentation requires Digital Asset Links on an HTTPS callback host. These observations do not establish why the reporter's Chrome handoff did not launch.
Related #184.
Testing
ProxyAuthRedirectInstrumentationTest: a same-gateway OAuth start that immediately redirects to the provider completes the HTTP fallback with the cookie set by the start response. A Chrome-equipped API 36 emulator checks the main-frame start and invokes the shared browser-launch guard used by popups; it does not drive an actual popup.RED/GREEN: the new HTTP gateway test failed on the base navigation code and passed with the change. On the Chrome-equipped emulator, sending the gateway start directly to Auth Tab made the cookie-safety test fail; removing the shared launch guard also failed it. Both guards were restored and passed. Changing the gateway fallback reason made its diagnostic assertion fail; the source was restored and passed.
Independent review: identified that launching the gateway start in Chrome can lose its callback state cookie. Main-frame handling and the shared browser-launch guard used by popup paths now keep the start in WebView. A follow-up review of commit
4932bb79c0c066ef8d4364f2a439e836772470b1found no new significant bug, but confirmed the test does not exercise a popup end to end. A correlated handoff and real provider testing remain needed before claiming Chrome sign-in is fixed..\gradlew.bat testDebugUnitTest lintDebug assembleDebug connectedDebugAndroidTest "-Pandroid.testInstrumentationRunnerArguments.class=com.hermeswebui.android.ProxyAuthRedirectInstrumentationTest#proxyGatewayOidc_sameOriginAuthorization_keepsStartInWebViewWhenBrowserSupportsAuthTab,com.hermeswebui.android.ProxyAuthRedirectInstrumentationTest#proxyGatewayOidc_sameOriginAuthorizationRedirect_continuesInApp,com.hermeswebui.android.ProxyAuthRedirectInstrumentationTest#proxyGatewayOidc_withSignInWithChromeAndHttpCallback_continuesInApp,com.hermeswebui.android.ProxyAuthRedirectInstrumentationTest#proxyGatewayOidc_keepsProviderInAppSoTheGatewayCallbackHasItsCookie" --no-daemon: passed on API 36 with Chrome 156 (four selected tests). An earlier run failed when a WebView navigation dropped a DOM-readiness JavaScript callback; the fixture now retries dropped callbacks until the existing readiness timeout, and the rerun passed..\gradlew.bat connectedDebugAndroidTest "-Pandroid.testInstrumentationRunnerArguments.class=com.hermeswebui.android.ProxyAuthRedirectInstrumentationTest#proxyGatewayOidc_sameOriginAuthorizationRedirect_continuesInApp,com.hermeswebui.android.ProxyAuthRedirectInstrumentationTest#proxyGatewayOidc_withSignInWithChromeAndHttpCallback_continuesInApp,com.hermeswebui.android.ProxyAuthRedirectInstrumentationTest#proxyGatewayOidc_keepsProviderInAppSoTheGatewayCallbackHasItsCookie" --no-daemon: passed on API 35 (three selected tests).python -m unittest discover -s tools/tests -p "test_*.py": passed, 121 tests.python tools/check_markdown.py: passed, 26 files.GitHub Actions on commit
4932bb79c0c066ef8d4364f2a439e836772470b1: passed all gates, including the full API 35 and 36 instrumentation suites.Manual device check: none. Tests used isolated emulators.
Not covered: a real popup round trip, Chrome Auth Tab callback or Digital Asset Links verification, a live gateway/Pocket ID flow, the reporter's device, direct WebView passkeys, and the upstream Dashboard root-route fix.
.\gradlew.bat testDebugUnitTest --no-daemon.\gradlew.bat lintDebug --no-daemon.\gradlew.bat assembleDebug --no-daemonpython -m unittest discover -s tools/tests -p "test_*.py"andpython tools/check_markdown.pyTargeted
connectedDebugAndroidTeston API 35 and API 36 emulators; CI runs the full suites on API 35 and 36.QA checklist
tools/qaagainst a real server, and the redactedreport.mdsummary is pasted below (or marked not applicable).README.md,ROADMAP.md,ARCHITECTURE.md, andAGENTS.mdare updated where behavior, setup, architecture, or workflow changed.enhancement,user-facing,bug,documentation,skip-changelog).Live QA summary (if applicable)
Not applicable: no injected WebUI script or shim changed. No live server was tested.
🤖 Generated with GitHub Copilot