Skip to content

Remove webauthn-json dependency#236

Merged
nicolastemciuc merged 3 commits intomasterfrom
nt--remove-webauthn-json
Aug 11, 2025
Merged

Remove webauthn-json dependency#236
nicolastemciuc merged 3 commits intomasterfrom
nt--remove-webauthn-json

Conversation

@nicolastemciuc
Copy link
Member

Summary

Stop using @github/webauthn-json dependency and start using navigator.credentials native API calls instead.

Why?

webauthn-json has been deprecated: github/webauthn-json#94

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.

Instead of strictly encoding the raw_id, the id attribute starts being stored.

The id is a base64url encoded version of PublicKeyCredential.rawId.
@nicolastemciuc nicolastemciuc force-pushed the nt--remove-webauthn-json branch from b57deaf to 3f0ebd7 Compare August 11, 2025 16:23
@nicolastemciuc nicolastemciuc changed the base branch from master to nt--use-virtual-authenticators-in-test August 11, 2025 16:23
Base automatically changed from nt--use-virtual-authenticators-in-test to master August 11, 2025 17:39
@nicolastemciuc nicolastemciuc merged commit b0fd595 into master Aug 11, 2025
1 check passed
@nicolastemciuc nicolastemciuc deleted the nt--remove-webauthn-json branch August 11, 2025 18:18
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.

2 participants