web-push - 什么是 VAPID?它为什么有用?

标签 web-push vapid

我最近刚刚了解 VAPID,并一直在寻找它存在的原因及其目的。 Mozilla's blog post解释说“如果我们发现问题,包含 VAPID 信息可以让我们联系您”,但我不太确定他们的意思。他们是否进行某种监控以防止其他人模仿您的服务?

最佳答案

VAPID specification的摘要解释了一切:

An application server can voluntarily identify itself to a push service using the described technique. This identification information can be used by the push service to attribute requests that are made by the same application server to a single entity. This can used to reduce the secrecy for push subscription URLs by being able to restrict subscriptions to a specific application server. An application server is further able to include additional information that the operator of a push service can use to contact the operator of the application server.

所以 VAPID 有两个原因。

第一个是将订阅的有效性限制到特定应用程序服务器(因此,通过使用 VAPID,只有您的服务器能够向订阅者发送通知)。

第二个是在推送通知中添加更多信息,以便推送服务运营商知道谁在发送通知。如果您的通知出现问题,接线员会知道您是谁并可以与您联系。此外,他们可以为您提供某种界面来监控您的推送通知。

关于web-push - 什么是 VAPID?它为什么有用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40392257/

相关文章:

java - 在 Java 中生成 VAPID key 并将其传递给 JavaScript PushManager

javascript - 在Rails中生成VAPID公钥并将其传递给Javascript

node.js - Lightsail AWS Node.js 永远启动

android - Chrome 推送通知如何检索推送数据?

php - Web 推送通知 : How to use Web Push PHP Library?

service-worker - 如果多个用户使用同一台设备怎么办?

javascript - Chrome 推送通知(注册并等待通知)

php - Web Push php 库 : Throws internal error