【问题标题】:how to create an encrypted certificate for ms graph subscription requests?如何为 ms graph 订阅请求创建加密证书?
【发布时间】:2022-08-04 21:19:48
【问题描述】:

我正在尝试为 MS Teams 聊天创建 MS Graph 订阅。 我一直在阅读此文档:https://docs.microsoft.com/en-us/graph/teams-changenotifications-teammembership

示例 POST 消息如下所示:

POST https://graph.microsoft.com/v1.0/subscriptions
Content-Type: application/json

{
  \"changeType\": \"created,deleted,updated\",
  \"notificationUrl\": \"https://webhook.azurewebsites.net/api/resourceNotifications\",
  \"resource\": \"/teams/{team-id}/members\",
  \"includeResourceData\": true,
  \"encryptionCertificate\": \"{base64encodedCertificate}\",
  \"encryptionCertificateId\": \"{customId}\",
  \"expirationDateTime\": \"2019-09-19T11:00:00.0000000Z\",
  \"clientState\": \"{secretClientState}\"
}

我不清楚如何创建加密证书或 certificateId 值

我目前正在谷歌搜索/浏览 MS 图表文档,但如果有人能指出我正确的文章,我将不胜感激。

    标签: microsoft-graph-api microsoft-graph-teams


    【解决方案1】:

    您需要在 Azure 上创建证书,并将其存储在 Vault 中。 然后,当您创建订阅时,您将使用:

    • encryptionCertificate 属性(您创建的证书)
    • encryptionCertificateId 属性(您自己的标识符)

    遵循 GraphAPI doc -> Develop\Use the API\Change notifications -> Notifications with resource data 上的这些说明 Managing encryption keys that you need for Notifications

    我建议你通过这个文档,它比你得到的例子更完整。 并且不要忘记验证端点!也在这个文档中描述。 Setup a subscription with resource data

    我希望它有帮助:)

    【讨论】:

      猜你喜欢
      • 2022-08-24
      • 2018-02-01
      • 1970-01-01
      • 2019-05-15
      • 2020-12-28
      • 2011-02-11
      • 1970-01-01
      • 2016-06-12
      • 1970-01-01
      相关资源
      最近更新 更多