Skip to content

Add/improve support for native JSON APIs #41

Open
@Firehed

Description

@Firehed

The next draft of WebAuthn (level 3) adds some major ergonomic improvements to the client side of the flows:

  • static PublicKeyCredential.parseCreationOptionsFromJSON()
  • static PublicKeyCredential.parseRequestOptionsFromJSON()
  • PublicKeyCredential.toJSON()

These methods collectively remove a lot of fussiness from client code, particularly around ArrayBuffer handling. They also add a de-facto standard wire format for client-to-server communication.

While these are only (as of writing) supported natively in Firefox, there's a library available to aid the transition until it has wider support (while experimenting with it, it did appear to deviate from the spec in the sense that some required fields were not present, but this should be inconsequential)

The library should add native support for these formats, as it can greatly improve ergonomics. I'm inclined to retain support for the original versions as well, since browser support may take a while and not everyone will want or be able to use the library. It's also well-tested and updating tests vectors may introduce unnecessary risk. Having said that, supporting only a single format is nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions