RobotsAndPencils / buford

A push notification delivery engine for the new HTTP/2 APNS service.
MIT License
474 stars 52 forks source link

initial support for Token Authentication (JWT) #66

Closed nathany closed 7 years ago

nathany commented 8 years ago

Just a start to enable use with Token Authentication, based on these slides https://developer.apple.com/videos/play/wwdc2016/724/

ref #63

service := push.NewService(http.DefaultClient, host)
// ...
id, err := service.Push(deviceToken, &push.Headers{Authorization: "eyJhbGciOiJFUzI1N"}, b)

Unfortunately this isn't working quite yet. I'm not even getting a InvalidProviderToken error from Apple.

❯ GODEBUG=http2debug=1 go run main.go -d devicetoken                      
2016/06/15 15:01:04 http2: Transport failed to get client conn for api.development.push.apple.com:443: http2: no cached connection was available
2016/06/15 15:01:05 http2: Transport creating client conn to 17.172.238.203:443
2016/06/15 15:01:05 Unhandled Setting: [HEADER_TABLE_SIZE = 4096]
2016/06/15 15:01:05 Unhandled Setting: [MAX_HEADER_LIST_SIZE = 8000]
2016/06/15 15:01:05 http2: Transport failed to get client conn for api.development.push.apple.com:443: http2: no cached connection was available
Post https://api.development.push.apple.com/3/device/devicetoken: http2: no cached connection was available
exit status 1
nathany commented 7 years ago

going dark on this (NDA) while working in Apple's pilot program in a private fork of Buford

nathany commented 7 years ago

Provider Authentication Tokens documentation is now public. https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH101-SW21