You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before #458, the PublicKeyCredential::__toString method just returned '{}', but now it tries to render the whole AuthenticatorResponse which contains raw binary data, not compatible with json_encode
Before #458, the PublicKeyCredential::__toString method just returned '{}', but now it tries to render the whole AuthenticatorResponse which contains raw binary data, not compatible with json_encode
Thank you for this report.
I do not remember why, but I do not see any reason for this class to implement Stringable.
Moreover, before 4.7, the class always returns {} (which has no sense) because it does not implement \JsonSerializable.
What I suggest for now is to log the descriptor instead:
Version(s) affected
4.7.0
Description
Since #458 this error occurs when registering or validating a key
It's triggered from
PublicKeyCredentialLoader::loadArray
this line renders the publicKeyCredential as string, and hits [
PublicKeyCredential::__toString
](https://github.com/web-auth/webauthn-framework/blob/87895ca9a1b6064b7e67c320878c09bfe230534d/src/webauthn/src/PublicKeyCredential.php#L26]Before #458, the
PublicKeyCredential::__toString
method just returned '{}', but now it tries to render the wholeAuthenticatorResponse
which contains raw binary data, not compatible withjson_encode
How to reproduce
Register or authenticate a key.
This happen to me in https://github.com/asbiin/laravel-webauthn-example/ but I guess it can happen in any application.
Possible Solution
Change the
__toString
method to not render theAuthenticatorResponse
?Additional Context
No response
The text was updated successfully, but these errors were encountered: