mylofi / webauthn-local-client

Browser-only utils for locally managing WebAuthn (passkey) API
https://mylofi.github.io/webauthn-local-client/
MIT License
100 stars 3 forks source link

support react-native #8

Closed getify closed 2 months ago

getify commented 2 months ago

support via https://www.npmjs.com/package/react-native-passkeys which mimics the WebAuthn navigator.credentials API.

also need to get the following working in react-native:

getify commented 2 months ago

this library also relies on crypto.subtle for its SHA256 hash, as well as for verification of non-Ed25519 signatures (since sodium only supports Ed25519 signatures). but react-native doesn't have crypto.subtle... so need to figure out some replacement for these pieces.

getify commented 2 months ago

possible solution to the crypto.subtle issue: https://github.com/webview-crypto/react-native-webview-crypto

getify commented 2 months ago

also need to patch over missing PublicKeyCredential:

getify commented 2 months ago

also need to adapt to the fact that the react-native-passkeys API (create(), get()) doesn't actually match the WebAuthn API exactly, specifically that in WebAuthn, you call create({ publicKey: { ... } }) but in the RN library, you call just create({ ... }).

getify commented 2 months ago

Have decided against this approach.