Click HERE to see how Saviynt Intelligence is transforming the industry. |
04/12/2022 01:03 PM
Hi,
I have a REST API that uses Basic authentication(username and password) along with an APIKey which is to be passed in the http header of my connection JSON as:
{
"authentications": {
"acctAuth": {
"authType": "Basic",
"url": "https://##########/NetForms/restapi/component/user",
"httpMethod": "POST",
"httpParams": {
},
"httpHeaders": {
"APIKey": "###########################"
},
"httpContentType": "text/html",
"properties": {
"userName": "############",
"password": "##########"
},
"expiryError": "Couldn't authenticate you",
"authError": [
"Couldn't authenticate you"
],
"timeOutError": "Read timed out",
"errorPath": "error",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Basic",
"accessToken": "Basic abcdef",
"testConnectionParams": {
"http": {
"url": "https://#########/NetForms/restapi/component/user",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"successReponse": [
200,
204
],
"successResponsePath": "",
"errors": [
"Couldn't authenticate you"
],
"errorPath": "error"
}
}
}
}
However, my connection JSON does not recognize the API key and I get a 401 unauthorized error.
The same call is working in Postman by passing the API key in the headers:
Is there any way I can pass this APIKey in Saviynt Connection JSON to be able to connect successfully?
Any help would be greatly appreciated.
Solved! Go to Solution.
04/12/2022 02:14 PM
Hi Arushi,
Is there a separate API to get the access token? if yes, then it won't be a basic connection type
if no, then the x API key need not be specified in the connection JSON.It can be specified under http Headers as shown below in the import and provisioning JSONS
sample:
"httpHeaders": {
"Authorization": "${access_token}",
"x-apikey": "**********"
}
Can you please share more details and screenshots from the postman if possible?
Thank you
Vedanth B.K
04/12/2022 02:14 PM
Hi Vedant,
Thanks for the information. I was able to fetch data by passing the API Key in the import and provisioning JSON.