electron-push-receiver icon indicating copy to clipboard operation
electron-push-receiver copied to clipboard

No way to get "auth" and "p256dh" keys

Open igor10k opened this issue 6 years ago • 4 comments

Looks like only token is exposed but auth and p256dh keys are also needed for encryption.

In fact it would've been better to expose an object representing PushSubscribtion instead of just token.

{
  "endpoint": `https://fcm.googleapis.com/fcm/send/dGcJGabyhHheJYlNGCeX....`,
  "keys": {
    "p256dh": "BIPUL12DLfytvTajnryr2PR...",
    "auth":"FPssNDTKnInHVndST...."
  }
}

igor10k avatar Nov 08 '17 17:11 igor10k

You want to have access to the encryption keys for sending notification ? You don't need those if you are sending notifications using FCM. FCM is handling the encryption part.

If you're talking about decryption, push-receiver already decrypts the notifications.

MatthieuLemoine avatar Nov 08 '17 19:11 MatthieuLemoine

And if you're talking about FCM registration. It's already taken care of by push-receiver that's why you only need the FCM token.

MatthieuLemoine avatar Nov 08 '17 19:11 MatthieuLemoine

@MatthieuLemoine Chrome 50+ allows receiving payloads within notification but to send this payload the back end needs those keys for encryption.

https://developers.google.com/web/updates/2016/03/web-push-encryption

igor10k avatar Nov 08 '17 19:11 igor10k

Ok I see the use case.

For now electron-push-receiver & push-receiver only supports sending notifications through FCM using the FCM serverKey provided by the Firebase console.

What I understand is that you want to use your own push server using the Web Push Protocol. Unfortunately, it's not currently supported by push-receiver.

But it would be great to add support for this.

MatthieuLemoine avatar Nov 08 '17 19:11 MatthieuLemoine