Last active
September 7, 2021 11:27
-
-
Save materkel/8ee313da4ceb5b301b2ac3fc9ace547a to your computer and use it in GitHub Desktop.
create facebook appsecret proof in NodeJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'); | |
let accessToken = 'your fb accesstoken' || 'facebookClientId' + '|' + 'facebookClientSecret' | |
let clientSecret = 'your fb client secret' | |
let appsecret_proof: crypto.createHmac('sha256', clientSecret).update(accessToken).digest('hex') |
I created a Gist for this as well. fb_appsecret_proof.js. @mfressdorf and @peterpeterparker's code works, maybe my take will help others. When I reference accessToken
in my Gist, keep in mind, this is the access token used when making Graph API calls for your Facebook App on behalf of the user using the App so, it would typically be the long term access token that you generated.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jyotman it's not working for me. What about you?