I am trying to verify the hmac in the
X-HubSpot-Signature V2 but we cannot seem to get a match. I have tried encoding the uri, decoding, encoding just the query string, encoding but with & and = safe, with query string, without, and I don’t even know how many other things. We are receiving a GET request so there is no request body but I have tried including request.json, request.data etc just for funsies. I verified the secret from env_vars does match the secret in my app. I followed the given python example and my code is below:
prehash_string = env_vars[‘hubspot_crm_card_secret’] + request.method + request.url
hashed_string = hashlib.sha256(prehash_string.encode(‘utf-8’)).hexdigest()
print(f’{hashed_string} == {hubspot_signature}')
if hashed_string == hubspot_signature:
print(‘authorized’)
return True
return False
Any idea what I am missing here?