fbsamples / fbsamples/whatsapp-api-examples

How to use signature validation

オープン
#13 コメント 1 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。