facebook graph x hub signature

Solutions on MaxInterview for facebook graph x hub signature by the best coders in the world

showing results for - "facebook graph x hub signature"
Lia
24 Jul 2019
1const FB_APP_SECRET = 'your facebook app secret';
2
3// requires
4const crypto = require('crypto');
5
6const verifyXHubSignature = req => {
7    const digest = crypto
8    .createHmac('sha1', FB_APP_SECRET)
9    .update(req.rawBody)
10    .digest('hex');
11    return req.headers['x-hub-signature'] === `sha1=${digest}`;
12};