apns2 icon indicating copy to clipboard operation
apns2 copied to clipboard

feat: add token support for client manager

Open lakim opened this issue 3 years ago • 3 comments

Fixes https://github.com/sideshow/apns2/issues/98

Description

This PR adds support for JWT token based clients to the client manager.

We are using apns2 to send Push Notifications to different applications (multiple team ids, multiple APNS keys, etc). We have been using this PR from @bdandy in production for months without any issue: https://github.com/sideshow/apns2/pull/160

But we need to upgrade apns2 to the latest version in order to fix a known CVE in github.com/dgrijalva/jwt-go.

This PR ports https://github.com/sideshow/apns2/pull/160 on master and adds tests.

More info

Using a client manager for token based clients is important in order to reuse connections as much as possible.

Also, Apple documentation clearly states:

APNs does not support authentication tokens from multiple developer accounts over a single connection.

For now, we use the token as the cache key, but we might want to test using the Team ID in order to respect what is recommanded by Apple.

lakim avatar Oct 17 '22 13:10 lakim

Any plan to merge this one @sideshow ? 🙏

defgenx avatar Feb 17 '25 15:02 defgenx

may I ask why this pr has not been merged? Does the token mode require client management?

limawanyan avatar Apr 07 '25 08:04 limawanyan

Any update to merge this PR @sideshow ?

defgenx avatar Jul 11 '25 07:07 defgenx