HTTP Connection Request to support Basic type and Token Auth type

Comments

5 comments

  • Tyler Lamparter Principal Product Manager
    Awesome Follow-up
    Engaged
    Top Contributor
    Answer Pro
    Celigo University Level 4: Legendary

    Amol B I think you may be confused on how our "refresh token" offering works. In your case, you should be using it. When the endpoint provides us with a 401 error code for unauthorized, we then trigger the refresh token mechanism to fetch a new token. For the values of token and refresh token in this setup, use dummy values. Upon saving, the refresh mechanism will kick in. Here is an example setup:

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

     

    From the docs, I wasn't 100% sure what field the token is returned in. You would just need to modify this to the actual field name that has the token.

     

     

    {
      "username": "value",
      "password": "value"
    }

    {
      "username": "copy this json structure to encrypted field. structure is here so that structure is known in the future after saving this connection",
      "password": "copy this json structure to encrypted field. structure is here so that structure is known in the future after saving this connection"
    }
    0
  • Aishwarya M J Referral Partner
    Engaged
    Celigo University Level 4: Legendary

    Hi Tyler Lamparter

    I have a similar requirement to establish an HTTP connection to platform named UNIS. UNIS requires that a token is passed in the header when making each request. The token can be generated using username and password, need to pass them in the request body. Since the token expires in 2 hrs., we need to configure the refresh token aswell. 

    I have setup the connection following your instructions in the previous comment. But I'm unable to authorize the connection.

    Could you please review the above connection setup and share your valuable feedback?

    Thanks in Advance

    0
  • Om Mishra

    Hi Aishwarya,

    The HTTP request body should be a valid JSON; therefore, you might face issues authorizing the connection. If you provide me with the HTTP request body structure for the /user/login POST URL, I can assist you in constructing the request body. You can then update your configuration for authorization.

    Thanks
    Om Mishra

    0
  • Aishwarya M J Referral Partner
    Engaged
    Celigo University Level 4: Legendary

    Hi Om,

    The request body structure for the toke generation is as follows:

    {
        "username": "value",
        "password": "value"
    }
     
    Kindly review and hare your suggestions.
     
    Thanks
    0
  • Om Mishra

    Thanks Aishwarya. I just referred to this API doc; you can use the request body below, In the doc its nowhere mentioned that you have to do base64encode. Please use the below request body and let me know if this works for you.

    {

    "username": "{{{connection.http.encrypted.username}}}",
    "password": "{{{connection.http.encrypted.password}}}"

    }

    Thanks,

    Om Mishra

    1

Please sign in to leave a comment.