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
The PublicKeyCredentialRequestOptions object is designed to be easily serialized into a JSON object. This will ease the integration into an HTML page or through an API endpoint.
I had the same issue today, the only way to make it work is to serialize it and send as JSON string:
This is the example in the docs:
use Symfony\Component\Serializer\Encoder\JsonEncode;
use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer;
// The serializer is the same as the one created in the previous pages
$jsonObject = $serializer->serialize(
$publicKeyCredentialCreationOptions,
'json',
[ // Optional
AbstractObjectNormalizer::SKIP_NULL_VALUES => true,
JsonEncode::OPTIONS => JSON_THROW_ON_ERROR,
]
);
Version(s) affected
5.0
Description
Works in 4.9 but not 5.0:
json_encode(\Webauthn\PublicKeyCredentialRequestOptions::create(random_bytes(32), allowCredentials: []))
I need to json_encode() it to submit the request to my site via a JSON-RPC endpoint.
The docs still say:
How to reproduce
With 4.9, I was using this code:
After upgrading to 5.0, this fails because the value of json_encode() is false.
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: