为 Office 365 推送通知指定 Headers

Specify the Headers for Office 365 Push Notifications

我正在创建 Outlook 订阅 as outlined here, and setting the NotificationURL to an endpoint on AWS API Gateway。这按预期工作。

但是,端点现在被锁定,需要授权令牌和 API 密钥才能访问。

如何在从 Office 365 发送的推送通知上设置 headers?

我认为您无法通过设置承载或类似方式验证从 Office 365 REST API 服务发送的请求。

您为 Office 365 REST 服务提供的 NotificationURL 必须可以公开访问。但是您 API 的其余部分只能通过身份验证访问。当然,您必须 implement/check ValidationTokenSubscriptionId 以避免被伪造 Outlook 订阅的恶意 REST 调用攻击。