How did I encounter this error? I was trying to parse signed_request from Facebook canvas via the following line:
fb_request = facebook.parse_signed_request(signed_request, APP_SECRET)
where
APP_SECRET = os.environ.get('FB_APP_SECRET', 'jhdklu3sh4o8y4o8fh34')
I realized that it couldn't read the environment variable and was using the default app secret so couldn't decrypt the signed request. My environment variables were in .bashrc of both regular user and root but it did not read. So I added them to the upstart script:
script
export HOME=/home/user/project
cd $HOME
export FB_APP_ID=859827u4fhk4vnf
export FB_APP_SECRET=4ojfo92ufo2489fyuo482fy2
. venv/bin/activate
exec gunicorn myapp:app
end script
No comments:
Post a Comment