Skip to content

feat: auth.webSession, sign-in in the system's web authentication sheet - #13

Merged
tygoegmond merged 1 commit into
mainfrom
feat/web-session-sign-in
Oct 16, 2026
Merged

tygoegmond merged 1 commit into
mainfrom
feat/web-session-sign-in

Conversation

@tygoegmond

Copy link
Copy Markdown
Contributor

Adds a bridge method for signing in with a web identity provider such as Google or Apple. Google doesn't allow sign-in inside an embedded web view, so the shell opens the sign-in page in the system's web authentication sheet instead of the Link screen's web view.

Protocol (bridge/PROTOCOL.md §7.1)

  • New capability and request: auth.webSession { url }.
    • Success: { callbackUrl }.
    • Errors: userCancelled, unavailable, and invalidParams when url isn't https.
  • The sheet closes when it reaches a URL with the plugchoice-link scheme, and that URL goes back to the page.
  • Shells never log the callback URL: it carries a one-time code.

iOS

  • ASWebAuthenticationSession with callback scheme plugchoice-link.
  • Not ephemeral, so it shares Safari's cookies: someone already signed in to the provider in Safari picks their account in one tap. iOS asks the user first.
  • The capability is always listed, and the host app needs no setup.

Android

  • Chrome's Auth Tab (androidx.browser:browser:1.9.0, AuthTabIntent).
  • The Auth Tab answers the activity that opened it, so no intent filter is needed and apps that include the SDK never compete for the scheme.
  • The capability is listed only when the default Custom Tabs browser supports Auth Tab.
  • A <queries> entry for CustomTabsService lets the library find that browser on API 30 and later. It merges into the host app's manifest.

Checks

  • iOS: xcodebuild test passes (199 tests). New tests cover the URL check, the capability, and unavailable when there is no window.
  • Android: testDebugUnitTest and lintDebug pass. New tests cover the capability and the URL check. :example:assembleDebug builds.

… sheet

Google refuses to sign in inside an embedded web view, so the page asks the
shell to open core's sign-in hop in the system's sign-in sheet
(`auth.webSession { url }` → `{ callbackUrl }`, PROTOCOL.md §7.1). The sheet
closes on the plugchoice-link scheme and the URL goes back to the page.

- iOS: ASWebAuthenticationSession with callback scheme plugchoice-link,
  sharing Safari's cookies. Listed always; the host app needs nothing.
- Android: Chrome's Auth Tab (androidx.browser 1.9 AuthTabIntent), which
  answers the activity that opened it, so no intent filter and no app
  competes for the scheme. Listed only when the browser supports Auth Tab;
  a <queries> entry lets the library find a Custom Tabs browser.

The callback URL holds a one-time code that is worth nothing without the
run's credential; shells never log it.
@tygoegmond
tygoegmond merged commit 2823e20 into main Oct 16, 2026
8 checks passed
@tygoegmond
tygoegmond deleted the feat/web-session-sign-in branch October 16, 2026 13:43
tygoegmond pushed a commit that referenced this pull request Oct 19, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.7.0](0.6.0...0.7.0)
(2026-10-16)


### Features

* auth.webSession, sign-in in the system's web authentication sheet
([#13](#13))
([2823e20](2823e20))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant