Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Shopify Engineering 6 min read Case study mediumAdept

Supporting Passkeys in Shop's Authentication Flows

Shop added passkeys (WebAuthn public-key credentials) to Shop Pay and the Shop app as a phishing-resistant alternative to email/SMS verification codes, using the webauthn-ruby gem in their Rails backend and serving the flow from an iframe so it works on merchant storefronts. Registration uses options_for_create to generate a server-stored challenge, then verify_registration to validate and store the credential; login uses verify_authentication and updates the sign count. Lessons include restricting subdomain use, requesting platform authenticators with resident keys, and storing and deleting challenges to prevent replay. Conditional UI is held back because the no-passkey desktop experience can confuse users.

Related posts

  • Flexible Authentication: Reimagining authentication for millions of users at Airbnb

    Airbnb Engineering easyNovice

    Airbnb rebuilt login and signup around an "Identify first then Challenge" model. Users first identify themselves by email, phone or social login, then a server-side policy engine picks the challenge most likely to succeed for that account and context, such as WhatsApp OTP in Brazil or Naver in South Korea. Every screen includes a server-ranked "Try another way" Challenge Picker, so users never hit a dead end. The whole flow is server-driven, with clients acting as thin renderers built on generated types. That design cut client code by 60% and the web bundle by 100KB, enabled 20+ experiments in three months without app releases, raised successful authentication by 2.6%, reduced duplicate accounts by 27% and lowered OTP costs by about 11%.

  • Making Open Source Safer for Everyone with Shopify’s Bug Bounty Program

    Shopify Engineering mediumAdept

    A Shopify bug bounty report showed that a leaked Rails development secret could be escalated to remote code execution because ActiveSupport's MessageEncryptor deserialized data with Marshal by default. Shopify patched its app to use JSON serialization, then contributed Rails changes making JSON the default serializer for MessageEncryptor and MessageVerifier starting in 7.1, with an upgrade path for existing apps. It also shares a patch that hooks Marshal.load and Marshal.dump in development and CI to flag unexpected calls from gems, tracking and deprecating Marshal use across an application.

  • No Display? No Problem: Cross-Device Passkey Authentication for XR Devices

    Meta Engineering mediumAdept

    Meta adapted the FIDO CTAP hybrid (cross-device) passkey flow for displayless or inaccessible-display devices such as Quest headsets by replacing the QR code with a companion-app delivery path. The headset browser builds the usual hybrid payload (fresh ECDH public key, session secret, routing info) as a FIDO URL and sends it via a GraphQL-based push notification to the Meta Horizon app signed into the same account. The app opens the URL through the OS passkey interface, either from a notification tap or by polling for pending requests that expire after five minutes. Standard BLE proximity, the encrypted tunnel and user verification then proceed unchanged, so the proximity and trust guarantees of hybrid transport are preserved without an on-device display.

  • Authentication in Ionic Angular with Supabase

    Supabase mediumAdept

    An Ionic Angular realtime messaging app built on Supabase demonstrates email/password signup and login, magic link authentication for web and native mobile, and route protection with Angular guards. The Postgres side defines users, groups and messages tables, adds Row Level Security policies so the public anon key is safe in the frontend, uses a security-definer trigger to copy new auth users into a public table, and publishes the messages table for realtime inserts. On the client, an AuthService wraps supabase.auth and tracks session state in an RxJS BehaviorSubject, loading the stored session with getUser() at startup because onAuthStateChange usually doesn't fire on app load. Most of the logic applies to any Angular web project.

  • Supabase Auth: SSO, Mobile, and Server-side support

    Supabase mediumAdept

    Supabase Auth adds SAML 2.0 single sign-on, a PKCE authorization flow for server-side rendering and mobile apps, and native Sign in with Apple on iOS. SSO providers are managed with new `supabase sso` CLI commands, and the provider identifier in the JWT can drive Postgres Row Level Security policies for multi-tenant isolation. PKCE replaces the implicit grant flow, which exposed tokens in URL fragments that servers can't read and that malicious mobile apps could intercept. It does this with a hashed code verifier and challenge, so an intercepted authorization code is useless on its own. Enabling it means setting `flowType: 'pkce'` in supabase-js, and a Next.js callback route exchanges the code for a session.

The quest for software engineering knowledge.

Look:
Layout: