Skip to content

Conversation

@joaquintomas2003
Copy link
Member

@joaquintomas2003 joaquintomas2003 commented Aug 6, 2025

This will make it easier to stop using webauthn-json.

With webauthn-json the create() method expects createOptions of type JSON. However, for using the browser's native API, the create() call must receive the options in type CredentialCreationOptions.

To pass from JSON to CredentialCreationOptions the method parseRequestOptionsFromJSON is used.
parseRequestOptionsFromJSON in turn, expects to receive this format: https://www.w3.org/TR/webauthn-3/#dictdef-publickeycredentialcreationoptionsjson

Therefore, the credential ids inside excludeCredentials need to be of type Base64URLString, which is not the case now.
As of now, the raw_id is being strict encoded which still doesn't comply with being of type Base64URLString.

With this PR, instead of strictly encoding the raw_id, the id attribute starts being stored.
The id is a base64url encoded version of PublicKeyCredential.rawId.

Related discussion:

Copy link
Collaborator

@santiagorodriguez96 santiagorodriguez96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

@joaquintomas2003 joaquintomas2003 merged commit 25d7df8 into main Aug 6, 2025
5 checks passed
@joaquintomas2003 joaquintomas2003 deleted the jt--stop_encoding_ids branch August 6, 2025 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants