You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would say the JWT path is strictly better. The major functional difference is that p12s expire and need to be regenerated every year, and doing so generally requires using Apple's OS X Keychain utility, or using openssl directly. Cryptographically they're both considered secure. The JWT option is more recent, having been introduced by Apple several years into APNs' lifetime, and so probably has more lifetime in front of it as well.
(disclaimer: I cannot represent sideshow or apple - I'm just a rando who watches this repository, and this has just been my experience)
Token-based authentication offers a stateless way to communicate with APNs. Stateless communication is faster than certificate-based communication because it doesn’t require APNs to look up the certificate, or other information, related to your provider server. There are other advantages to using token-based authentication:
You can use the same token from multiple provider servers.
You can use one token to distribute notifications for all of your company’s apps.
Because trust is established at the server-level, individual notification requests contain only your payload and a device token. They don't include an authentication token, which reduces the size of each notification request slightly.
Note that Apple stop short of suggesting which one to use but I agree with @froodian that tokens are generally superior, and you should use them if possible. Certs were the original way to authenticate before Apple bought in token based auth. As @froodian said, certs expire every year which can be annoying. You also have to make sure they are created for the right app and the right push environment (development vs sandbox), and you have to make sure you export them correctly and they are in the right format. Basically tokens are way simpler and less work.
What are the pros and cons of using a p12 certificate vs APNs JWT Provider Authentication Tokens?
The text was updated successfully, but these errors were encountered: