Comments

7 comments
Date Votes
  • Official comment

    Jared Fraley as a part of the release tomorrow, November 8th 2023, we natively can support this auth type via the universal HTTP connector. See below setup details:

    Basic {{{base64Encode connection.http.encrypted.username ":" connection.http.encrypted.password}}}

    {{{split responseHeaders.authorization ' ' 1}}}

  • Jared Fraley you would need to set the auth method on the connection to "token", then configure refresh token mechanism to use basic authentication. Here is an article on it and some example configs: https://docs.celigo.com/hc/en-us/articles/360045127771-Set-up-a-token-based-HTTP-connection#step-d.

    0
  • Jared Fraley, I may take back what I said. Are you sure the bearer token is returned within the header of the response?

    0
  • According to the documentation, yes.

    0
  • Jared Fraley, unfortunately there isn't a way to currently handle that use case because we expect the token response to be in the body and we don't have a way to grab the headers and parse out the token from there. 

    There is a less clean way to do this with a myApi if you're open to that?

    0
  • I am open to ideas. How would myApi work?

    0
  • Jared Fraley it looks like I hit wall there as well. Virtual exports don't return the response headers, only response body, so it doesn't look like it's possible to use a myApi for this either. However, with the help of Anirudh Sundaram, he mentioned that we can get the the returned headers from import steps. So what I've done is make 2 flows.

    1. The first flow will get the connection details of the PriceMole connection made within Celigo via our apis. From there it will call PriceMole to get a new bearer token, then it update the PriceMole connection in Celigo via our apis. Note that a connection to Celigo itself does not count against your license.
    2. The second flow will then run and export the data from PriceMole using the updated credentials. This second flow will be set to run after the first flow runs so that whenever it runs there will be a fresh token.

     

    Here is how to go about setting this up:

    1. Download the flow zip here.
    2. On the homepage of integrator, click upload in the top right.
    3. Proceed with installing the integration.
    4. Configure the integrator IO connection.
      To do this, you'll need to create an api token from the left screen.
      Base urI: https://api.integrator.io
      Auth type: Token
      Token: paste the token you generated here
      Send token via: Header
      Header Name: Authorization
      Header scheme: Bearer

      Under the advanced section, put this into the encrypted and unencrypted fields:
      {"username":"actual value is in encrypted field, this field is here to remember the structure","password":"actual value is in encrypted field, this field is here to remember the structure"}

      Modify the encrypted field section by putting your own credentials.
      Save

    5. Setup the PriceMole connection
      Base urI: https://pricemole.io
      Auth type: Token
      Token: put a dummy value in for now
      Send token via: Header
      Header Name: Authorization
      Header scheme: Bearer

      Under the advanced section, put this into the encrypted and unencrypted fields:
      {"username":"actual value is in encrypted field, this field is here to remember the structure","password":"actual value is in encrypted field, this field is here to remember the structure"}

      Modify the encrypted field section by putting your own credentials.
      Save

    6. Open up the "update connection token" flow, open the first export step, and replace the connection id in the relative url with your PriceMole connection id. This can be found by going to the connections tab on the left hand side, opening the PriceMole connection, and grabbing the id from the url.
    7. Finish out the second flow within this flow zip to land the PriceMole data where you need it and then go to flow 1 and setup "next integration flow"
    8. Schedule the first flow to run maybe and not the second flow since we have to first get a fresh token.
    1

Please sign in to leave a comment.

 

Didn't find what you were looking for?

New post