Not able to get web hook signature from redirect URL headers,

Former Member
Former Member

We are using webhooks to get events(create,update) from dynamics community to ICS , In the webhooks we have to use “webhook signature” for validation which is comes from request headers  as per document (https://community.telligent.com/community/12/a/developer-training/c/webhooks ). Now web hook signature is not able get from redirect URL headers, Please check until that we have a blocker for validation.

 

Eg : string hashSignature = HttpContext.Request.Headers["X-Telligent-Webhook-Signature"];

Parents
  • Now web hook signature is not able get from redirect URL headers

    Could you elaborate what you mean by this? Is the registered webhook handler issuing a redirect to the Community?

  • Former Member
    0 Former Member in reply to Ben Tiedt

    Hi Ben,

    Below is code snippet as per documentation(https://community.telligent.com/community/12/a/developer-training/c/webhooks ) of webhook.

    -------------------------------------------------------------------------

    string senderUrl = HttpContext.Request.Headers["X-Telligent-Webhook-Sender"];
    string hashSignature = HttpContext.Request.Headers["X-Telligent-Webhook-Signature"];

    string rawPostData;
    using (var reader = new System.IO.StreamReader(HttpContext.Request.InputStream))
    {
    rawPostData = reader.ReadToEnd();
    }

    // Validate the posted data's authenticity
    string calculatedSignature = CalculateSignature(rawPostData, SECRET_KEY);
    if (!hashSignature.Equals(calculatedSignature))

    ----------------------------------------------------------------------------

    In the last line, we are trying to compare hashSignature which is provided by Telligent framework to the calculatedSignature generated by rawPostData &  SECRET_KEY.

    Once this condition matches we proceed further, but in current scenario we are unable to receive any value from HttpContext.Request.Headers["X-Telligent-Webhook-Signature"] 

    So, please guide me if i am missing any configuration to receive value successfully.

    Thanks

  • If you are attempting to redirect the response on your side you shouldn't.  There should not be an expectation that when you do a redirect that headers are redirected as well(they generally are not).  

Reply Children