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

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?

  • 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

Reply
  • 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

Children