trying to mock github webhook request, get: “X-Hub-Signature does not match blob signature”

China☆狼群 提交于 2019-12-04 12:54:13

You need to set content of X-Hub-Signature as parameters with sha1 field :

var payload = request.data;
console.log("Using payload as " + payload)
var hash = CryptoJS.HmacSHA1(payload, environment.secret).toString(CryptoJS.enc.Hex)
postman.setGlobalVariable("signature", "sha1=" + hash);

From validating payloads from Github :

No matter which implementation you use, the hash signature starts with sha1=, using the key of your secret token and your payload body.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!