Closed HusseinTaha closed 1 year ago
Hi! What version of Node.js are you using?
Hello, Hope you are well
It's v12.22.12
That version is not supported, I'm afraid. You'll need v15.6.0 or later.
mmm, Even I tried to implement the token thing (using jsonwebtoken) and call the Apple API outside this library, and getting the same. Do you think its the same as well requiring newer node version ?
I don't actually think your issue is related to Node but even if you manage to resolve it, you'll need still need v15.6.0 or later. Otherwise you'll encounter the same error as #10.
Regarding your issue, I'm guessing you are using the wrong key, key ID or issuer ID. Are you sure that you are using an API key for the App Store Server API (as opposed to a key for App Store Connect API)?
We're trying to fetch order by using the lookup order api https://developer.apple.com/documentation/appstoreserverapi/look_up_order_id
we did generate the key by following the documentation on the apple form.
I also tried to debug the things in the library, but it seems its not calling the apple api yet. The error is being thrown before the request. I mean while generating the token.
Could it be related to #17? The order lookup endpoint is only available in the production environment.
We are receiving the below error always, we changed the params, different keys, anything will return the same error.
Error: The request is unauthorized; the JSON Web Token (JWT) is invalid. at AppStoreServerAPI.<anonymous> (/node_modules/app-store-server-api/dist/cjs/AppStoreServerAPI.js:158:31) at step (/node_modules/app-store-server-api/dist/cjs/AppStoreServerAPI.js:52:23) at Object.next (/node_modules/app-store-server-api/dist/cjs/AppStoreServerAPI.js:33:53) at fulfilled (/node_modules/app-store-server-api/dist/cjs/AppStoreServerAPI.js:24:58) at processTicksAndRejections (internal/process/task_queues.js:97:5) transactions---- Error: The request is unauthorized; the JSON Web Token (JWT) is invalid. at processTicksAndRejections (internal/process/task_queues.js:97:5) { isHttpError: true, status: 500, code: 'UnknownError', data: undefined, source: undefined } []
our code here: