Closed chaotixkilla closed 3 years ago
You have to pass the buffer by yourself before instead of doing it inside the function. I am doing like this in my project and all is working well
@akanass Either way, shouldn't the example project rectify this issue then? I'm basing my project off the example one, and the conversion isn't mentioned anywhere from what I've seen
I apologize for the confusion. The example project doesn't do any such conversion because the AuthenticatorDevice
type was updated to make credentialPublicKey
into a Buffer, and so the example project now tracks all of these as Buffers
within its inMemoryUserDeviceDB
:
(the LoggedInUser
type defined in the example project references the AuthenticatorDevice
type)
verifyAssertion()
, then, expects the credentialPublicKey
to be a Buffer
as a property on the AuthenticatorDevice
you pass in as the authenticator
argument:
Edit: I tried to document these change as best I could in the release notes for v2.0.0:
https://github.com/MasterKale/SimpleWebAuthn/releases/tag/v2.0.0
I'll gladly incorporate any feedback you might have for me on these notes if I need to be more specific on any of it.
This PR fixes an issue occuring when validating assertion. When the process enters
convertPublicKeyToPEM()
, the following error is thrown:I believe this is caused because commit
548aa64bbbcfc70491a7ce2b103f9bd78ac010b6
changes the function to acceptBuffer
, instead ofstring
, but the argumentpublicKey
is being sent as a Buffer object and not a Buffer, resulting in the error above