[ad_1]
I am receiving JWT from Apple for In-App-Purchases and want to confirm them once I decode them.
I am utilizing ruby (with ruby on rails) so I do:
JWT.decode(params[:signedPayload], nil, true, { algorithm: 'ES256', root_certificates: root_certificates })
I get the foundation certificates from https://www.apple.com/certificateauthority
- Apple Inc. Root
- Apple Laptop, Inc. Root
- Apple Root CA – G2 Root
- Apple Root CA – G3 Root
And the payload is base64 encoded JWT, however decoded it seems one thing like:
{
"notificationType": "DID_CHANGE_RENEWAL_PREF",
"subtype": "UPGRADE",
"notificationUUID": "386fe04a-7caf-40b1-91ca-a4e29f2d135f",
"information": {
"bundleId": "com.socializusapp",
"bundleVersion": "73",
"surroundings": "Sandbox",
"signedTransactionInfo": "eyJhbGciOiJFUzI1NiIsIng1Y...",
"signedRenewalInfo": "eyJhbGciOiJFUzI1NiIsIng1Yy..."
},
"model": "2.0",
"alg": "HS256"
}
How can I confirm the payload is right? I attempted one other non-public key I take advantage of for apple register however would not work
Possibly I need not confirm and I can simply decode the signed fields? However then how do I decode them?
[ad_2]
