Skip to content

Instantly share code, notes, and snippets.

@nicholasareed
Created December 11, 2011 23:27
Show Gist options
  • Save nicholasareed/1463469 to your computer and use it in GitHub Desktop.
Save nicholasareed/1463469 to your computer and use it in GitHub Desktop.
Python POST Authentication
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