Created
December 11, 2011 23:27
-
-
Save nicholasareed/1463469 to your computer and use it in GitHub Desktop.
Python POST Authentication
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
import hmac | |
# Get token_secret from Settings page | |
inbox_hooks_access_token = 'secret_token_here' | |
hmac_hexdigest = hmac.new(inbox_hooks_access_token, request.raw_post_body).hexdigest() | |
if hmac_hexdigest == request.headers['X-InboxHooks-Post-Auth']: | |
return True | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment