Open ptmkenny opened 2 days ago
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