I am using following link as guide for me to authorize the api I am configuring in my Zendesk webhook:
https://developer.zendesk.com/documentation/event-connectors/webhooks/verifying/
and I am writing a code equivalent to the this function in python isValidSignature(signature, body, timestamp) but I am not able to get an hmac signature that is matching signature submitted to me in my headers :
def isValidSignature(signature, body, timestamp):
key = webHookSecret.encode('utf-8')
hmac_result = hmac.new(key, (timestamp+body).encode('utf-8'), hashlib.sha256)
hmac_result = hmac_result.digest()
if signature == str(base64.b64encode(hmac_result), 'utf-8'):
return True
else:
return False
Please advise what should I modify to fix this issue?
I don't think this is necessarily an issue with the webhook you're using. I've gone ahead and put together an example that might be helpful to you. Take a look through this and see if you're able to identify what might be causing the error on your end.
If you continue to run in to errors, let me know and we can pull this in to a ticket so I can take a look at your code in more detail.
Thanks!
Tipene