How to get the JWS after subscription was purchased inside the IOS APP

After subscription purchase, We plan to do JWS signature validation on the server-side instead of decoding the JWS in the IOS app. Currently, after purchase, I am getting the decoded details instead of the JWS in response. Could you please let me know which methods give the JWS after the subscription purchase inside the IOS app?

Method's I am calling the inside the APP

  1. Product.purchase() ->given the purchase result.
  2. After purchase, we get the transaction object as a response
  3. Transaction.finish() //concluding the transaction
  4. Fetch the purchase information of the product transaction.currentEntitlement

Sample response after the purchase was made. But we required the JWS instead of the below-decoded data.

({
 "header" : {
  "alg" : "ES256",
  "x5c" : [
   "**********",
   "***********",
   "*****************"
  ]
 },
 "payload" : {
  "bundleId" : "com.*******",
  "deviceVerification" : "",
  "deviceVerificationNonce" : "",
  "expiresDate" : 1640100970000,
  "inAppOwnershipType" : "PURCHASED",
  "originalPurchaseDate" : 1631601452000,
  "originalTransactionId" : "1000000877135811",
  "productId" : "com.e**********",
  "purchaseDate" : 1640100670000,
  "quantity" : 1,
  "signedDate" : 1640100987198,
  "subscriptionGroupIdentifier" : "*****",
  "transactionId" : "1000000935313340",
  "type" : "Auto-Renewable Subscription",
  "webOrderLineItemId" : "************"
 },
 "signature" : "64 bytes (verified)"
})

Hello Thirumala_Reddy,

it looks you are actually receiving the JWS. But probably you were expecting to see "JWS Compact Serialization", which looks like this: jws_header.jws_body.jws_signature (all parts Base64 encoded)

In your case, the serialization used is "Flattened JWS JSON Serialization".

Both serializations are valid according to JWS specification. See https://datatracker.ietf.org/doc/html/rfc7515#section-7.2.2

How to get the JWS after subscription was purchased inside the IOS APP
 
 
Q