Skip to content

v0.18.5 - Google sign-in out of FedCM, with a way out of the iframe

Pre-release
Pre-release

Choose a tag to compare

@sleepymor sleepymor released this 22 Oct 08:25
· 28 commits to master since this release

Google sign-in for the WebGL build, third round. The origin registration worked and the button now
renders inside itch.io's iframe - but clicking it opened the account chooser, which sat on
"Processing your request" and then closed itself with no token.

The cause
With FedCM enabled for the button, Google completes the credential exchange by calling
navigator.credentials.get() from GIS's iframe inside the game page. A third-party frame is refused
unless the embedder delegates publickey-credentials-get via the iframe's allow= attribute, and
itch.io delegates nothing (verified by reading the live iframe tag). The promise rejects after the
player has already authenticated and the result is discarded.

What changed

  • use_fedcm_for_button: false, so the legacy transport finishes the exchange in its own top-level
    popup where none of that applies. use_fedcm_for_prompt stays true - the two flags are deliberately
    opposite and the harness asserts both, because equalising them reintroduces this bug.
  • error_callback is now subscribed and reports popup_closed, popup_blocked, idp_timeout,
    issued_failed or gep_error with GIS's own detail. Deliberately non-terminal: every one of those is
    a failed attempt, not a failed session, so the card survives and retry works.
  • The overlay gains a "Sign in in a new tab" exit, hidden until GIS fails. A top-level tab is
    first-party, so all three gates are simply absent.
  • probeFedCM logs publickey-credentials-get=denied|granted|prompt, so a build states which world it
    is in instead of requiring inference from a player report.
  • The bridge now watches the failed handback directly: window.open is wrapped to record the endpoint
    reached (single-use secrets redacted), and a message listener names the case that matters most -
    event.origin === "null", which is what a sandboxed popup looks like and a plausible reason a fully
    authenticated sign-in still returns nothing. Payloads reduce to a key list, never contents.
  • VerifyNonce replaces two inline copies of the same equality check and sits below both platform
    #if blocks so EditMode can reach it. Separates "carrying no nonce" from "carrying the wrong one".

Coverage
Tools/WebGL/gsi-bridge-test.mjs 79 -> 108 assertions. Assets/Tests/Net 13 -> 26 tests. Full EditMode
997/1003 passed, 2 failed, 4 skipped; both failures pre-existing and unrelated
(SimpleAI_MakesLegalMoves, SceneSummarize_CountsObjectsCorrectly). 0 errors, 0 warnings on compile.

Known, not fixed (design decisions)

  • CR-04: automatic reshuffle vs. the specified deck-out condition.
  • CR-05: Volley resolves against Core Actives only.
  • CA-01: Interdiction Net advertises an unimplemented mechanic.

Verification note
A green CI run proves the artifacts were built and uploaded. It does not prove Google sign-in
completes in a browser on itch.io. If the legacy transport has also been retired by the GIS build
itch.io serves today, this release does not fix the symptom - but error_callback, probeFedCM and the
popup watchers will name the reason in the console, and the new-tab exit is on screen meanwhile.