Skip to content

Onboarding sign-in crashes on old WebViews (de-Googled phones): polyfill crypto.randomUUID in signin/welcome/account #65

Open

Description

@melvincarvalho

Problem

The seeded onboarding pages (signin.html, welcome.html, account.html) import solid-oidc@0.0.8, which needs crypto.randomUUID (Chromium 92+, secure-context) and crypto.subtle (PKCE SHA-256 + DPoP). On de-Googled Android phones the Android System WebView is often stale (it updates via the Play Store, which isn't installed), so crypto.randomUUID is missing — and sign-in dies at the welcome → sign-in step with a cryptic:

crypto.randomUUID is not a function

This blocks the Solid-Pod-on-a-de-Googled-phone path (the whole point of the Android build).

Repro

De-Googled phone → jspod pod → welcome → "sign in" → crash (no useful message).

Fix (page-level, quick)

Polyfill crypto.randomUUID via crypto.getRandomValues (broadly supported, not secure-context-gated) before the solid-oidc module import, in all three onboarding pages. (signin.html already patched locally:)

<script>
if (typeof crypto !== 'undefined' && crypto.getRandomValues && !crypto.randomUUID) {
  crypto.randomUUID = function () {
    var b = crypto.getRandomValues(new Uint8Array(16));
    b[6] = (b[6] & 0x0f) | 0x40; b[8] = (b[8] & 0x3f) | 0x80;
    var h = []; for (var i = 0; i < 16; i++) h.push((b[i] + 0x100).toString(16).slice(1));
    return h[0]+h[1]+h[2]+h[3]+'-'+h[4]+h[5]+'-'+h[6]+h[7]+'-'+h[8]+h[9]+'-'+h[10]+h[11]+h[12]+h[13]+h[14]+h[15];
  };
}
</script>

Add the same to welcome.html (restores session on load → can call randomUUID) and account.html.

Caveat

This fixes only randomUUID. solid-oidc also needs crypto.subtle for PKCE/DPoP, which old WebViews / non-secure contexts lack and which can't be cheaply polyfilled (DPoP = real ECDSA key-gen/sign). So if subtle is also missing, sign-in still fails — the durable fix there is a modern browser. (subtle is the older API, so on a localhost secure context it's usually present and the polyfill is enough.)

Deployment

These pages are seeded to the Android pod from jspod@${JSPOD_PAGES_VERSION} via jsDelivr (overwrite=true), so the fix reaches devices via: republish jspod → bump JSPOD_PAGES_VERSION in js-pod/android → rebuild APK (re-seeds the patched pages on next launch).

Also (device-level)

Ship/keep a modern browser in the de-Googled phone image — the real fix for the crypto.subtle requirement.

Related

Activity

  1. melvincarvalho commented on Jun 11, 2026

    @melvincarvalho
    ContributorAuthor

    Upstream fix landed in JSS (JavaScriptSolidServer#558)

    The same crash class on JSS's own IdP login page is now fixed at the source, and JSS could go further than a page-level polyfill because it owns the call site (jspod here is constrained by the solid-oidc library boundary, hence the polyfill):

    • Dropped the redundant crypto.randomUUID() entirely — JSS's passkey-options endpoint already mints the challengeKey server-side (Node crypto) and the client echoes it back, so no browser UUID was ever needed.
    • Added a secure-context / WebAuthn guard on both the login and registration ceremonies that degrades to the password form / "Skip for now" — addressing the caveat noted in this issue (the polyfill only fixes randomUUID, never the crypto.subtle/WebAuthn wall).

    Relevance to jspod: the JSS-served IdP pages no longer crash on stale WebViews regardless of jspod. jspod's own seeded onboarding pages (signin.html/welcome.html/account.html) still import solid-oidc@0.0.8 directly, so this issue's page-level polyfill is still needed for those until JavaScriptSolidServer/solid-oidc#10 (the in-library graceful-degradation) lands. So: keep this open for the seeded pages, but the JSS-side surface is handled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions