Skip to content

Instantly share code, notes, and snippets.

@bgmort
bgmort / parseSignedRequest.js
Last active June 2, 2020 03:09 — forked from cyakimov/gist:1139981
Decode Facebook signed_request with NodeJS
// Fixed an error with character replacement, removed a dependency, included imports, throw errors, and fixed global variables
var crypto = require('crypto');
//remove a dependency on b64url
function atob(str) {
return new Buffer(str, 'base64').toString('binary');
}
//this is not used here, but to leave it out would be like passing the salt without the pepper.
function btoa(str) {