Skip to content

Conversation

Keroosha
Copy link
Contributor

@Keroosha Keroosha commented Jul 21, 2025

Fixes #2298

createPublicKeyCredential doesn't implement toJSON method from PublicKeyCredential prototype PublicKeyCredential: toJSON method at developer.mozilla.org

This PR implements that method by manually mapping PublicKeyCredentialJSON model

Testing strategy

Repro at webauthn-tojson.cybergulag.today

I patched Webauthn.NET demo to use PublicKeyCredential.toJSON method on completeAuthentication and completeRegistration steps
WebAuthn.NET lib.js

Passwordless and Usernameless flow should work fine on PR version

1.9.9.1 release will fail on missing toJSON method as mentioned in #2298

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)

@Keroosha Keroosha marked this pull request as ready for review July 22, 2025 14:49
@Keroosha Keroosha changed the title toJSON implementation for AuthenticatorAttestation and AuthenticatorAssertion toJSON implementation for createPublicKeyCredential Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: 'toJSON' called on an object that does not implement interface PublicKeyCredential.
2 participants