Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:25
What would you like to do?
Check a Dentally Webhook Signature
# request_signature - the signature from the X-Dentally-Signature header
# request_body - the JSON body of the webhook request
# secret - the secret for the webhook
require "openssl"
digest ="sha256")
calculated_signature = OpenSSL::HMAC.hexdigest(digest, secret, request_body)
if calculated_signature == request_signature
# Signature matches, everything is good
# Ignore the webhook as the signature is invalid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment