Closed harryfb closed 1 year ago
I had a few of these as well a couple of days ago. The error message is The request is unauthorized; the JSON Web Token (JWT) is invalid.
.
I think it must've been an isolated issue on Apple's part as I haven't encountered them before or had any in the last few days. I'll go ahead and close the issue but feel free to re-open it if you're still seeing these errors.
@agisboye / @harryfb - problem in our case when we encountered this was clock skew between local and App Store server. Check that iat/nbf/exp have a little margin in them to account for clock skew.
Hi,
It works properly on Sandbox but gets an error The request is unauthorized; the JSON Web Token (JWT) is invalid
when calling requestTestNotification
on Production. I'm using the same key and IDs.
Do you guys have a similar issue?
Version: 0.7.0 Node: 18.12.0
Looks like related to this issue: https://developer.apple.com/forums/thread/711801
For anyone else who encounters the issue - after releasing the app to the app store, I no longer get 401 response, and the API works as expected for both production and sandbox TIDs.
My app has not been released yet and it seems that Apple doesn't let me test it on production..
I'm getting a
401
response intermittently when callinggetSubscriptionStatuses
. The issue looks to be time-based, as when I make successive calls (and the previously generated token is picked up fromthis.token
) I get a200
status - largely on the second attempt.If I force
getToken()
to generate a new JWT on each call, by removing the expiration checking logic, the issue starts intermittently affecting every call. So it seems like Apple is failing to verify newly created JWTs that are immediately passed into the request.It doesn't strike me as being environment related seeing as it is intermittent and hardcoding
token
inmakeRequest()
to a JWT generated bygetToken()
(that originally resulted in a401
status) always gives me successful responses.Any help is much appreciated!
Version: 0.6.0 Node: 16.13.0