fbsamples / fbsamples/whatsapp-api-examples

How to use signature validation

未關閉
#13 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
291
分支
159
PR 合併指標
30 天內沒有已合併 PR

描述

So i've been trying to validate several payload by following the code below.

[https://github.com/fbsamples/whatsapp-api-examples/blob/main/signature-validation-with-webhooks-payloads/app.py](url)

But the signature always different with the one in x-hub-signature-256 and ending up with "INVALID SIGNATURE HASH". Fyi i am using my app-secret as Token in that code.

example of payload that i am trying to validate :

```
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "1xxxxxxx",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "62xxxxxx",
"phone_number_id": "1xxxxxx"
},
"contacts": [
{
"profile": {
"name": "Somebody"
},
"wa_id": "62xxxxxx"
}
],
"messages": [
{
"from": "62xxxxxx",
"id": "wamid.example",
"timestamp": "1740476674",
"text": {
"body": "halo"
},
"type": "text"
}
]
},
"field": "messages"
}
]
}
]
}
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。