postman - 当 includeResourceData=true 时,MS 图形创建订阅的 webhook 失败
问题描述
{
"changeType": "created,updated,deleted",
"notificationUrl": "https://somewebsite.com/mswebhook/graph/notifications",
"resource": "/teams/{team-id}/channels/{channel-id}/messages",
"expirationDateTime": "2019-12-30T09:41:21Z",
"clientState": "",
"includeResourceData": true,
"encryptionCertificate": "TUlJQklUQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FRNEFNSUlCQ1FLQ0FRQlhFL0xOZjVYYVY4ZFlXbWFuSU9qUwphSnhyUG1tN0dHN0lWOGYwV2RjZDltbUkvaTVXQzhCNFBYaVBKREtKTnVFL2QvMXo5TndSbjR1UFBQQm9sN1BWCmdudVJ6UmZJSVEvUW1TZjYwUi9LUnYybHVlZzVwNW84Qk5UNDczdTRCbVZJVHNBWlF1eG43RGdnUi9JZlQzSVgKelpMdzNXWitDYzJyS1crblpmbUwwU0NiN21EL3RTZ3VqQUJPVEVvS0xBODkvNWhUamhuNzcvWHJzUTYrV1hMVgpKL3NtVDJvU3R3TzBnYXRIRUkwWkRSL0VYNkdVWDRRRVI4M0puS2hPSDJrZzZQNlZUMDFGUEw0Nk5WemZydWE4ClVob052Z0VlQStPY2xBOU5mUUpJQnVKUVFTbGZ0TmhYODJtVEdhVEtBTFN1bWZieUNac1ljQ3l4MXQ5RXF6Qi8KQWdNQkFBRT0=",
"encryptionCertificateId": "id",
"lifecycleNotificationUrl": "https://somewebsite.com/mswebhook/graph/notifications"
}
当这个请求是从邮递员发出的
{
"error": {
"code": "InvalidRequest",
"message": "System.Security.Cryptography.CryptographicException: Cannot find the requested object.\r\n\r\n at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)\r\n at System.Security.Cryptography.X509Certificates.X509Utils._QueryCertBlobType(Byte[] rawData)\r\n at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromBlob(Byte[] rawData, Object password, X509KeyStorageFlags keyStorageFlags)\r\n at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData)\r\n at Microsoft.Graph.Encryptor.Encryptor.ValidateCertificate(String certificate, String& errorMessage) in X:\\bt\\1070414\\repo\\src\\Dev\\Notifications\\Notifications.Azure\\Encryptor\\Encryptor.cs:line 293",
"innerError": {
"request-id": "e578bdba-2c47-41d7-a0da-5395b05e4203",
"date": "2019-12-31T06:57:59"
}
}
}
没有 includeResourceData 属性,订阅和通知工作正常。我在选择encryptionCertificate 属性时遇到问题。目前我在encryptionCertificate 中传递Base64bit 编码的2048 位RSA 公钥(在线生成)。
解决方案
推荐阅读
- scala - Scala - 基于逻辑添加元素
- python - 编写迭代函数
- python - How can i insert row into table sqlalchemy object?
- android - 在锁定任务模式下允许访问 USB 设备对话框
- python - 嵌入式环境中的 Python 子进程块
- r - 用于 Phi 系数的 R 循环
- linux - linux内核如何为睡眠进程计时?
- node.js - 在 Sequelize.js 的聚合函数中使用 case-when
- r - 仅用于 4 x 4 图的底部面板的 X 轴标题
- c++ - unique_ptr 中模板和继承的重载解决方案