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.
Context
createSeamlessAuthClientimportsstartRegistrationandstartAuthenticationfrom@simplewebauthn/browserand calls them at four sites.webauthnSupport.tsreadswindow.PublicKeyCredentialandnavigator.credentials. Everything else in the clientis 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
verifyRegistrationResponseandverifyAuthenticationResponsewith no server change.Scope
isSupported,create, andget, taking and returningWebAuthn JSON so the API contract is identical across implementations.
@simplewebauthn/browseron web andreact-native-passkeyson native.Notes
differs.
react-native-passkeysexposes the PRF extension, sowebauthnPrf.tsmay port ratherthan degrade. Untested, so treat as promising rather than settled.
Relates to #64.