HTTP Connection Request to support Basic type and Token Auth type
We are working on Zuore Revenue (RevPro) Application. As there is no inbuilt connector for it, so we are using HTTP adapter to establish RevPro connection.
1) RevPro follows the Basic type and Token type Authentication.
2) To connect or do any API call with RevPro we need a token to be generated and that token gets expired every 30 mins. There is no refresh token concept in RevPro.
3) To get the token we need to use Auth type basic. We need to select Auth type as Basic and give Username and Password. And the token will be generated in Response Headers.
4) We have achieved the following things.
- We have connected to RevPro using Basic Auth type i.e. Username and Password
- Using the same connection we have generated the Token in a flow (Integration)
https://yourHost/api/integration/v1/authenticate
Limitations-
1) We want to achieve the above two steps in a single connection.
2) There is no refresh token in RevPro.
Please provide us with a workaround to generate Token every 30 mins
-
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 -
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 -
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 Mishra0 -
Hi Om,
The request body structure for the toke generation is as follows:
{"username": "value","password": "value"}Kindly review and hare your suggestions.Thanks0 -
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.
Comments
5 comments