Repository navigation
Conversation
…refuses the WebView Google answers an embedded WebView with disallowed_useragent, so the shell has been telling those users the sign-in method is not supported. It now opens the server's sign-in page in the OS auth session and brings the session back through the server's one-time-token hand-off, bound to a PKCE verifier kept in memory. The token is redeemed from inside the WebView, on the server's origin only, so the cookie lands in the WebView's store and the shell keeps nothing. A server that does not register ai.objectos.mobile keeps the notice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Maintainer ruling (2026-11-04, in chat): the shell redeems the token with the injected script. No Console consumer is added. This settles the first of the three choices listed on #148. Checked against
Still open, not ruled: the auth session's entry URL, |
|
Maintainer ruling (2026-11-04, in chat): the entry moves to the server. This settles the point left open in the comment above. Filed as objectstack-ai/objectstack#29997. The app will open only the hand-off route in the auth session, and the server sends a signed-out page navigation to its own sign-in page. So This PR's code does not change yet. It keeps today's entry until #29997 has shipped, because an older server answers the new entry with raw JSON. Then this PR needs:
The redeem script and the probe stay as they are. |
Refs #148. This does not close it: the card's acceptance needs device builds, and the three platform cards below.
Clause-②: no
Metadata-protocol: none
维护者速读
expo-crypto是原生改动,要新构建,OTA 到不了旧包。lib/shell/system-sign-in.ts顶部注释和buildRedeemScript;External IdP sign-in from the shell (ASWebAuthenticationSession / Custom Tabs) for providers that refuse embedded WebViews #148 上的流程说明列了三个卡面没定的选择。pnpm exec jest __tests__/lib/shell/system-sign-in.test.ts,预期 39/39。What changes
When a navigation would reach a provider that refuses embedded WebViews (the check
sign-in-excursion.tsalready had), the shell no longer stops at a notice:GET /api/v1/auth/one-time-token/handoffwith this app's callback. The route checks the scheme before the session, so401means registered.400(unregistered) or404(no route) keeps today's notice, and no browser opens.lib/shell/system-sign-in.tsmakes an RFC 7636 verifier (32 random bytes, kept in memory) and opens<server>/_console/login?redirect=<hand-off with the S256 challenge>throughopenAuthSessionAsync, ephemeral on iOS.ai.objectos.mobile://auth/callback?token=T, parsed strictly: exactly onetoken, in the token's alphabet.redirectIncomingPathdrops this link, so on Android the token never becomes a router path and the Console underneath stays put.ConsoleWebViewholds the token until a Console is ready, then injects a script that POSTsT.verifierto/one-time-token/verifyonly iflocation.originis the server's. The page moves to the Console, or to/login?error=handoff_failed, whose banner already explains a failed sign-in. A token whose connection was switched away from is dropped.Also:
expo-cryptofor the random bytes and digest,ai.objectos.mobileregistered as a second scheme becauseTrustedAppSchemeSchemarefusesobjectos, and docs (HYBRID-SHELL.md"System sign-in",DEPLOYMENT.md,DEVICE-TESTING.md).The server enforces single use, the one-minute expiry, the interception refusal, the five-minute freshness rule and the cross-site refusal (objectstack
one-time-token-handoff.ts). The shell does not repeat them.Waiting on
redirectcannot reach the hand-off (measured on 18.3.0: 页面不存在).os servehas notrustedAppSchemessetting (measured).Tests
pnpm exec jest: 50 suites, 1097 tests passed, before the last formatting-only revert; theConsoleWebViewandlib/shellsuites were re-run after it (14 suites, 532 tests passed).tsc --noEmitclean. ESLint clean on the changed source directories and the new test file.system-sign-in.test.tscovers the RFC 7636 appendix B vectors, the entry URL, callback refusals, the redeem script run against a stubbedlocationandfetch(including that it sends nothing from another origin), and the probe.ConsoleWebView.test.tsxcovers the session start, one session at a time, a token arriving before and after ready, a connection switch, and each outcome.Run on a simulator
iOS Release build on an iPhone 17 Pro simulator, fresh install, against a local
@objectstack/cli@18.3.0with the scheme patched in and fake Google client values, so the Google button appears and its navigation is refused. A local proxy stands in for objectstack-ai/objectstack#29971: it answers the Console's mis-prefixed redirect with a302to the real hand-off route. The sign-in inside the auth session used the local dev seed admin, not Google.admin@objectos.ai400)/login, with the Console's banner: 单点登录未能完成…(handoff_failed)huayan.objectos.ai(18.2.0, route answers 404), Cloud excursion then GoogleAgainst the same server over HTTP, statuses only: signed-out hand-off
401; hand-off302to the app scheme;Sec-Fetch-Site: cross-site400;Talone400;Twith a guessed verifier400; then the realT.verifier200with a cookie; replay400.Not verified
Linking, and backgrounding the Custom Tab, are both unproven.🤖 Generated with Claude Code