Can you please confirm that I can use V3 signature in webhook listener?
Any suggestion?
Please see below the powershell code
Thank You
# I get the json body $FormContent = [System.IO.StreamReader]::new($context.Request.InputStream).ReadToEnd() #I create a utf-8 encoded string of requestMethod + requestUri + requestBody + timestamp. The timestamp is provided by the new X-HubSpot-Request-Timestamp header.
#example: POSThttps://xxxxxxxxxxx/contact[{"eventId":"100","subscriptionId":1334304,"portalId":25205759,"occurredAt":1638463236537,"subscriptionType":"contact.creation","attemptNumber":0,"objectId":123,"changeSource":"CRM","changeFlag":"NEW"}]1638467214429 $my_key=$context.Request.HttpMethod+$context.Request.Url+$FormContent+$context.Request.Headers['X-HubSpot-Request-Timestamp'] $enc = [System.Text.Encoding]::UTF8 $encmy_key= $enc.GetBytes($my_key) #I create an HMAC SHA-256 hash of the resulting string using the application secret as the secret for the HMAC SHA-256 function. $secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" $hmacsha = New-Object System.Security.Cryptography.HMACSHA256 $hmacsha.key = [Text.Encoding]::ASCII.GetBytes($secret) $signature = $hmacsha.ComputeHash([Text.Encoding]::ASCII.GetBytes($encmy_key)) #Base64 encode the result of the HMAC function $signature = [Convert]::ToBase64String($signature) if ($context.Request.Headers['X-HubSpot-Signature-v3'] -ne $signature){ write-output "invalid signature" }else{ write-output "valid signature" }