Closed SurgeCode closed 2 months ago
Hello @SurgeCode thank you for reporting this.
So I have conduct a small experiment on this in my local environment and try to focus on the error message: Error: Type error: expected ‘id’ or ‘rawId’ field of request to be ArrayBuffer, got rawId object and id string
Default Chrome passkey:
1Password (password management tool) on Chrome:
There is slight difference, but we can see that rawId
is in ArrayBuffer
In here, 'rawId' is in Uint8Array
format where it aligns with error message. So I have taken the investigation further and see what it should be:
https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential
https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/rawId
In terms of definition, it is expecting ArrayBuffer
NOT Uint8Array
.
So at this point, Bitwarden is mutating the format that is set by W3C standard.
I will continue to seek for solution on getting Bitwarden working by injecting a thin logic to re-construct fido2 friendly format
Progress update: I manage to get the creation working via data format conversion. However using them to sign in isn't working with no error. (1Password works with signin flow as well)
Will continue investigate the issue on sign in..
I have created PR for the solution. Basically Bitwarden converts some of the properties from ArrayBuffer
to Uint8Array
and it was simple enough to convert them back.
Once this PR gets merged and deployed, then I will update fast-auth-signer
package with latest version and from there, it should work as expected.
Will continue to update on this PR
If you are using @near-js/biometric-ed25519 directly, please update the version number to 1.1.2
and try above issue again. If it is not fixed, please let me know. (If it works for you, please also leave a comment here if then, will lose this issue)
We will also aim to update fast-auth-signer
soon.
@SurgeCode we just release a new version of biometric package(@near-js/biometric-ed25519@1.2.1
). Can you see if this issue is resolved?
Since there was no further feedback, will close this ticket.
Prerequisites
near-api-js
.Description
When calling the createKey() method with the Bitwarden password manager extension that uses passkey the crendetials Id seems to have an incorrect format causing an error
On the left side you see a working payload that contains an ArrayBuffer and on the right side a Uint8Array
Reproducible demo
No response
Steps to reproduce
createKey()
methodExpected behavior
Create key should not throw an error
Actual behavior
“Error: Type error: expected ‘id’ or ‘rawId’ field of request to be ArrayBuffer, got rawId object and id string”
Your environment
No response
Self-service