FAQ: Which data should I encode when building a webhook listener (HMAC authentication)?

Q. I'm building a webhook listener using HMAC authentication and I’m unsure which data to encode. I see options to choose the algorithm and to set a key, but not for the value itself. Is it the URL, the request body, or something else?
A. To get a signature, encode the request body using the specified algorithm and secret.

Check out this related article in our Help Center: Create webhook listeners

1

Comments

24 comments
Date Votes
  • can you give clear step by step procedure of screenshots i tried this article but im not getting the result as 401

     

    https://docs.celigo.com/hc/en-us/community/posts/4409699690395-Construct-an-HMAC-request-via-Postman-to-send-test-requests-to-Celigo-webhooks

    0
  • Hi Kumar,

    We would like to understand how you encountered the error and what actions you took that led to this error.

    Thanks,
    Om Mishra

    0
  • actually im trying HMAC authentication webhook for one of my clients

    i tried as the same procedure as in the link i posted 

    but im getting 401 error if any possibilities please help

     

    0
  • Hi Kumar,

    I just tried and it's working for me. Below are the steps I used to make it work.

    1. I created a webhook listener in IO and provided the necessary details. For the Key (secret) value, I used: "secret".

    2. I entered the POST public URL in Postman and used the script mentioned in the earlier post.

    3. In the above screenshot, I defined the HMAC variable using the same script I'm using in the Pre-request Script, as shown in the screenshot below.


    4. I received a 204 response code and was able to see the data in IO.



    Hope this helps.

    Thanks,
    Om Mishra

    0
  • thanks Om MishraKathyana Queeman it is working fine through post man 

    one more last doubt how we will set this through celigo https like what we did in postman

    0
  • Hi Kumar Mouthik Tumuluri

    Do you mean how to set this up through the integrator.io interface rather than through Postman? We have some instructions here: Set up a webhook listener. There's a section specifically on HMAC. 

    0
  • Hi Kumar,

    For testing, I have used "secret" as the secret value, which should also be entered in the Pre-request Script in Postman. This is the same value you will use when configuring your webhook in IO.


    Thanks,
    Om Mishra

    0
  • How we will do that same thing in celigo platform through http

    0
  • Thanks for Om Mishra for clarifying the doubt in postman

    0
  • How can we achieve the same thing in celigo platform through http Om Mishra

     
    0
  • Kathyana Queeman ya webhook listener is done working fine with the help of Om Mishra 

    but how do i set up http so i invoke webhook it from another flow 

    0
  • Kumar Mouthik Tumuluri

    Do you want to invoke a webhook from another flow in integrator.io? I'm not sure about that. Webhooks send an HTTP POST message over the web in real-time to an endpoint when an event occurs in an application. When an event triggers a webhook request, the source application sends a message to a specified URL, and a webhook listener receives the message and then executes operations according to the message's content. 

    If you mean that you want an "event" (like a flow ending) in IO to trigger a webhook flow, that might be possible, but I'm not sure. Perhaps Om Mishra can help. I know you can daisy chain flows in integrator.io, but I'm not sure how much help that will be. 

    0
  • Yes like you used pre requisite script right

    what type of settings need to be done in celigo Http in another flow to invoke the webhook

    Om Mishra Kathyana Queeman

    0
  • Hi Kumar Mouthik Tumuluri

    Let me check on this and get back to you. I'll reach out when I have something concrete to share. Thanks! 

    0
  • 0
  • i want http that calls hmac anyways i know that one 

    0
  • Kumar Mouthik Tumuluri

    Does this solve your problem or are you looking for something else? 

    Thanks!

    0
  • i want like how can we do the configuration of that hmac webhook settings in a http connector for invoking the hmac webhook connector , you showed the example of invoking through postman, i m researching for invoking hmac webhook through celigo connector for anypossibility

    0
  • take your time no issues and post it here

    0
  •  Hi

    Kathyana Queeman 

    Om Mishra

    https://docs.celigo.com/hc/en-us/articles/360039326071-Handlebars-helper-reference#hmac this one can be used 

    since hmac converted values goes in header "test"

    can u refer this handle bar exp this looks this exp can be used in configuring http

    and please help me know how to send the values of HMAC webhook that u used in the above example 

    in following expression 

    into HTTP header

     

    {{hmac "algorithm" key "encoding" field keyEncoding}}
    0
  • hi Om Mishra

    any clue on this setting of those credentials of hmac webhook in http/integrator.io of celigo in another flow for invoking hmac webhook

    0
  • Hi Kumar,

    Apologies for the delayed reply. The purpose of the Pre-request Script in Postman was to calculate an HMAC SHA-256 hash of the request data using 'test' as the secret key. It then encodes this HMAC value in Base64 format and saves the encoded string as an environment variable named "hmac" within Postman.

    For your HTTP requests, you can utilize the hmac value by incorporating the handlebar syntax as follows:

    {{hmac "sha256" "test" "base64" request.data}}

    This handlebar custom helper allows you to dynamically include the HMAC signature in your HTTP requests. For more details on how to use this custom helper, please refer to the provided document.

    I hope this explanation is helpful. Should you have any further questions, please don't hesitate to ask.

    Thanks,
    Om Mishra

    0
  • Hi Om Mishra

    Thanks for the reply 

    please can you give ur full implementation of it in http along with connection of celigo

    if u dont mind as what you have provided  for postman

     

    Thanks

    kumar

    0
  • hi Om Mishra

    Can you give  full implementation please with http in celigo

    0

Please sign in to leave a comment.

 

Didn't find what you were looking for?

New post