Hi,
We are building a system that integrates with APNs using the Token-Based Authentication method. While testing, we encountered the 429 TooManyProviderTokenUpdates error
and would like clarification on the exact conditions that trigger this response.
Our Testing Scenario:
- Private Key: We keep the same Private Key constant across requests.
- TEAM_ID and KEY_ID: For testing purposes, we change the TEAM_ID and KEY_ID for every JWT we generate.
- Requests: Each generated JWT is used to call the
/3/device/{token}
API endpoint.
Observed Behavior:
- When we test with different TEAM_ID and KEY_ID combinations, we initially receive
403 InvalidProviderToken,
which is expected because the TEAM_ID and KEY_ID combinations are invalid. - However, if we change the TEAM_ID and KEY_ID and make multiple calls (e.g., more than two within 20 minutes), we start receiving
429 TooManyProviderTokenUpdates.
- If we switch to a different IP address (via VPN) after receiving the 429 error, we revert to receiving
403 InvalidProviderToken.
Our Use Case:
We are building a system where multiple server clusters handle multiple apps (some under the same Apple Developer account, others under different accounts). Each server generates JWTs for requests to the APNs /3/device/{token}
API.
Our Questions:
- What specific conditions cause the
429 TooManyProviderTokenUpdates
error? Does APNs monitor token updates at the level of TEAM_ID and KEY_ID, or does it consider additional factors such as the originating IP address or shared infrastructure? - How does APNs handle frequent changes in TEAM_ID and KEY_ID within a single server or cluster?
- Is there any documentation or guidance on managing JWTs effectively in a distributed system with multiple apps and servers?
- Does APNs limit JWT updates based on IP address or API endpoint usage across multiple apps sharing the same Apple Developer account?
We would greatly appreciate any clarification on these points and guidance on best practices for managing JWTs in a multi-cluster environment.
Thank you!