Skip to content

[BUG] TooManyProviderTokenUpdates #34

@itcohorts

Description

@itcohorts

@kylebrowning Thanks for putting so much work in on this tool! I've been attempting to implement it in a project I'm working on and I noticed the following:

When sending an APNS message to multiple tokens, each time APNSwiftRequestEncoder.write() is called the jwt is regenerated. This causes Apple's servers to respond with TooManyProviderTokenUpdates

To Reproduce
Configure a connection to Apple's APNS service.
Send more than 5 messages to different tokens.
The service will start to reply with TooManyProviderTokenUpdates

After dumping the object to the terminal I noticed that the bearer tokens were different for each requested message. They bearer token should have been the same for each message.

HeaderTableEntry(name: "authorization", value: "bearer **eyJ[redatcted]ifQ.eyJpc[redatcted]cxfQ.[redacted]490i**") HeaderTableEntry(name: ":path", value: "/3/device/_redacted_________________________1325e345a0daef141dec8c0bd78d") 

HeaderTableEntry(name: "authorization", value: "bearer **eyJ[redatcted]ifQ.eyJpc[redatcted]cwfQ.[redacted]RjTg**") HeaderTableEntry(name: ":path", value: "/3/device/________________________redacted_________________________005e320") 

HeaderTableEntry(name: "authorization", value: "bearer **eyJ[redatcted]ifQ.eyJpc[redatcted]cwfQ.[redacted]od1k**") HeaderTableEntry(name: ":path", value: "/3/device/27a18________________________redacted_________________________9cc1b") 

Expected behavior
jwt's should only be generated at most once every 20 minutes. There should be some sort of state/expiration on JWT generation so that the target does not throw TooManyProviderTokenUpdates

Platform:
Ubuntu 18.04
Linux swiftynix 4.15.0-51-generic #55-Ubuntu SMP Wed May 15 14:27:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-minor-version-bumpThis PR needs a minor version bump

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions