StoreKit2 Errors on iOS 17

I noticed on iOS 17 that calling AppTransaction.shared fails with following errors. Here is the code:

     let result: VerificationResult<AppTransaction> = try await AppTransaction.shared
            
     NSLog("Result \(result)")

It does not hit the NSLog statement and instead throws the following error logs.

Error getting app transaction: Error Domain=ASDErrorDomain Code=500 "(null)"   UserInfo={NSUnderlyingError=0x281815050 {Error Domain=AMSErrorDomain Code=301 "Invalid    Status Code" UserInfo={NSLocalizedDescription=Invalid Status Code, AMSURL=https://mzstorekit-sb.itunes.apple.com/inApps/v1/receipts/createAppReceipt?REDACTED, AMSStatusCode=401, AMSServerPayload={
errorCode = 500317;
}, NSLocalizedFailureReason=The response has an invalid status code}}}
 Received error that does not have a corresponding StoreKit Error:
 Error Domain=AMSErrorDomain Code=301 "Invalid Status Code" UserInfo= {NSLocalizedDescription=Invalid Status Code, AMSURL=https://mzstorekit-   sb.itunes.apple.com/inApps/v1/receipts/createAppReceipt?REDACTED, AMSStatusCode=401,  AMSServerPayload={
errorCode = 500317;
}, NSLocalizedFailureReason=The response has an invalid status code}
Received error that does not have a corresponding StoreKit Error:
Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo=.{NSUnderlyingError=0x281815050 {Error Domain=AMSErrorDomain Code=301 "Invalid Status Code" UserInfo={NSLocalizedDescription=Invalid Status Code, AMSURL=https://mzstorekit-sb.itunes.apple.com/inApps/v1/receipts/createAppReceipt?REDACTED, AMSStatusCode=401, AMSServerPayload={
errorCode = 500317;
}, NSLocalizedFailureReason=The response has an invalid status code}}}

Is the user you are calling this with authorized in App Store Connect to use this app in the Sandbox environment?

What is the procedure for authorizing a particular Sandbox user to use a particular app in App Store Connect?

StoreKit2 Errors on iOS 17
 
 
Q