One Google click: how way A and way B work

Both A and B give the person one Google screen and no stray account, even when they sign in from the wrong side of the world. Today's flow needs two Google screens and leaves a stray account. We tested this on one computer with a stand-in for Google and Apple, 5 of 5 runs each.

The spike's pick is B (the broker): it also covers Apple, and it guards every way in. B has five serious gaps that are not fixed yet. They are listed below.

WayGoogle screensStray accountsApple
Today2 when the guess is wrong1 in every wrong-guess runNot measured
A: Google first10No (needs a code change to Logto)
B: broker10Yes, 1 Apple screen

Who is who

We have two home regions. A person's account lives in one of them. A fresh phone does not know which.

PersonOn a fresh phone or laptop.
Our appThe first sign-in screen.
GoogleThe account chooser.
LookupA list: email to home region. Our own list, not Google's.
Logto SingaporeThe sign-in server for the Singapore home.
Logto United StatesThe sign-in server for the United States home.
BrokerWay B only. A small service we run that talks to Google for everyone.

The story in all three drawings: the person lives in Singapore, but is in the United States on a fresh device. Our app guesses by location, so it can guess wrong.

How to read a drawing

Today (the problem)

Our app must pick a home before it knows who the person is. Here it picks wrong.

What goes wrong today

Way A: Google first, on our own screen

Our own screen asks Google first. Only then do we pick the home. No guess is needed.

Tested: 1 Google screen and 0 stray accounts, 5 of 5 runs, with the wrong guess. New people and a blocked pop-up also worked (1 run each). Needs no change to Logto and no new service.

What can go wrong with A

Way B: a small broker we run

The broker is the only thing Google ever talks to. It learns the person once, then answers for Google when the home Logto asks.

Tested: 1 Google screen and 0 stray accounts, 5 of 5 runs, with the wrong guess. Also worked: a new person, Apple (1 Apple screen), a person who starts on the wrong Logto page, and one region's broker stopping mid-sign-in (the other region finished it).

What can go wrong with B

Known, not fixed yet: these are built in before production

A security review found 5 serious gaps in the test broker. We ran each one against a private copy and all 5 were confirmed. They are the to-do list for the real build, along with 5 more must-fixes of lower risk (10 in all).

1. A stranger's Google login can be finished in your browser. You could end up signed in to the stranger's account.

Fix: tie each login to the browser that started it.

2. The short-lived "just signed in" note can be copied. For its 2 minutes of life it works in other browsers too, and more than once.

Fix: make it single use, and tie it to one browser.

3. That note is stored too widely. Other sites under our login address could read it or plant one. We proved the broker accepts a planted note. We did not run a real browser to prove delivery.

Fix: keep it only for the broker's own address, with the strictest browser rules.

4. If the lookup fails, everyone looks like a new person. They would be signed up in the wrong home.

Fix: on any lookup error show an error page. Only a clear "not found" means new.

5. A leaked broker key lets someone sign in as anyone, in both homes, even people with a password. This follows from how the broker works. It is about key care.

Fix: keep the key in a managed key vault, turn off automatic linking by email for broker sign-ins, and alert on sudden spikes.

The other fixes: single-use codes, check the email is verified, separate Google and Apple settings, limits and timeouts on every outside call, key rotation, and a record of every sign-in the broker issues.

A next to B

QuestionA: Google firstB: broker
Google screens (wrong guess)11
Stray accounts00
AppleNoYes
Person opens a Logto page directlyNot coveredCovered, sent home
Secret in the web addressYes, valid 1 hourNo, lives 1 to 2 minutes
New service to runNoneYes, in every region
New master keyNoneYes, one shared key
Changes to Logto codeNoneNone
One region downNot affectedOther region finishes it
Fixes needed before productionNo full review yet10 must-fixes

A is a strong runner-up if we only ever need Google. B wins when we need Apple or full coverage.

Not tested yet

Spike run on 17 Nov 2026. Everything ran locally. Nothing was built for production.