larksuite / oapi-sdk-java

Apache License 2.0
242 stars 88 forks source link

消息卡片回调报错The result of signature verification failed #115

Closed githipy closed 9 months ago

githipy commented 9 months ago

官方文档示例: https://open.feishu.cn/document/server-docs/event-subscription-guide/event-subscription-configure-/encrypt-key-encryption-configuration-case image

SDK计算签名源码: image

签名算法不一样?

githipy commented 9 months ago

签名内容,到底是encryptKey 还是 verificationToken?

githipy commented 9 months ago

终于签名正确了,自己debug,签名算法使用SHA-256,签名的内容:timestamp + nonce + encryptKey + bodyString

githipy commented 9 months ago

又发现了官方文档:使用的SHA-1 https://open.feishu.cn/document/common-capabilities/message-card/add-card-interaction/message-card-security-verification

应该是代码更新了,文档和SDK都没跟上

githipy commented 9 months ago

SDK版本1.0.0-rc3,回调选择旧,可以了。 ![Uploading img_v3_0289_247a4b22-5912-49f3-aa47-75f463dcb49g.jpg…]()