-
-
Notifications
You must be signed in to change notification settings - Fork 201
toJSON implementation for createPublicKeyCredential #2613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
signature: kpxcArrayBufferToBase64Url(response.signature), | ||
userHandle, | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add missing ;
.
publicKeyAlgorithm: response.getPublicKeyAlgorithm(), | ||
attestationObject: kpxcArrayBufferToBase64Url(response.attestationObject), | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add missing ;
.
clientExtensionResults, | ||
type, | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add missing ;
.
return kpxcStringToArrayBuffer(window.atob(str?.replaceAll('-', '+').replaceAll('_', '/'))); | ||
}; | ||
|
||
const kpxcArrayBufferToBase64Url = function (buff) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy this function directly from passkey-utils.js
.
Fixes #2298
createPublicKeyCredential
doesn't implement toJSON method from PublicKeyCredential prototype PublicKeyCredential: toJSON method at developer.mozilla.orgThis PR implements that method by manually mapping
PublicKeyCredentialJSON
modelTesting strategy
Repro at webauthn-tojson.cybergulag.today
I patched Webauthn.NET demo to use
PublicKeyCredential.toJSON
method oncompleteAuthentication
andcompleteRegistration
stepsWebAuthn.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