Charca / bootbot

Facebook Messenger Bot Framework for Node.js
MIT License
974 stars 252 forks source link

Support appsecret_proof #90

Open Charca opened 6 years ago

Charca commented 6 years ago

Facebook provides the option to secure Graph API requests with an appsecret_proof hash. More info here: https://developers.facebook.com/docs/graph-api/securing-requests/

This hash is generated with sha256 using the access_token and app_secret, which we already require in the BootBot constructor.

Implementing this should be as simple as adding a useAppSecretProof boolean option to the BootBot constructor, which will be false by default, but if set to true, we should generate the hash using the crypto library and add it to the request to Graph API in sendMessage.