I went ahead and duplicated this to PHP and Ruby, writing some unit tests, which all seem to pass, but I'm curious if anyone else has experienced anything of the like and what they did.
ChatGPT recommends using JSON Canonicalization Algorithm (JCA) RFC 8785, which seems legit at first glance.
While I'm sure this will work all just well and good, I'm curious to hear anyone what kinds of trials and errors anyone else has gone through on such a seemingly simple task.
and your code produces
{"widget":{"dataB":"\u20ac30","dataA":"aaa"}}
The signatures will be different. The JSON spec doesn't require any ordering of fields or say much about how strings must be represented. This is all discussed in sec 3.2 of RFC8785 https://www.rfc-editor.org/rfc/rfc8785#name-generation-of-ca...You don't say how your work's custom message request signer works, but yes, you have to have the exact same json on both ends to match signatures.