Answers for "facebook graph X-Hub-Signature"

1

facebook graph X-Hub-Signature

const FB_APP_SECRET = 'your facebook app secret';

// requires
const crypto = require('crypto');

const verifyXHubSignature = req => {
    const digest = crypto
    .createHmac('sha1', FB_APP_SECRET)
    .update(req.rawBody)
    .digest('hex');
    return req.headers['x-hub-signature'] === `sha1=${digest}`;
};
Posted by: Guest on June-21-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language