I am investigating the CyberSource REST API and want to test the JSON Web Token Authentication method as documented here: https://developer.cybersource.com/api/developer-guides/dita-gettingstarted/authentication/GenerateHe.../omeglz /shaglevoojio
I am unable to replicate the sha256 hash of the JSON payload described in the JWT Payload/Claim Set section.
{ "clientReferenceInformation" : { "code" : "TC50171_3" }, "orderInformation" : { "amountDetails" : { "totalAmount" : "102.21", "currency" : "USD" } } }
I've attempted to use the sha256sum command in binary and text format on a file containing the payload example. I've also attempted running this command on different permutations of this payload, such as without whitespace or newlines.
I expect to get the example hash of
2b4fee10da8c5e1feaad32b014021e079fe4afcf06af223004af944011a7cb65c
but instead get
f710ef58876f83e36b80a83c8ec7da75c8c1640d77d598c470a3dd85ae1458d3 and other dissimilar hashes.
What am I doing wrong?
10-05-2022 02:29 AM
If I understand correctly, you are trying to call API after generating the JWT Header.
Did you refer to this: https://github.com/CyberSource/cybersource-rest-samples-java/blob/master/src/main/java/samples/authe... ? OR
https://github.com/CyberSource/cybersource-rest-samples-java/blob/master/src/main/java/samples/authe... ?
10-05-2022 10:08 AM