Skip to content

feat(client): extract passkey ceremonies behind a platform port #124

Description

@Bccorb

Context

createSeamlessAuthClient imports startRegistration and startAuthentication from
@simplewebauthn/browser and calls them at four sites. webauthnSupport.ts reads
window.PublicKeyCredential and navigator.credentials. Everything else in the client
is transport.

That direct dependency is what ties the client to the DOM. Naming it as a port is most
of what is needed to share the flow logic with a native binding.

A spike confirmed the ceremonies themselves are compatible: native assertions from both
iOS and Android were accepted by the API's verifyRegistrationResponse and
verifyAuthenticationResponse with no server change.

Scope

  • Introduce a passkey port with isSupported, create, and get, taking and returning
    WebAuthn JSON so the API contract is identical across implementations.
  • Back it with @simplewebauthn/browser on web and react-native-passkeys on native.
  • Move the four call sites onto the port.

Notes

  • The option and response payloads are WebAuthn JSON either way. Only the ceremony
    differs.
  • react-native-passkeys exposes the PRF extension, so webauthnPrf.ts may port rather
    than degrade. Untested, so treat as promising rather than settled.

Relates to #64.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions