Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/21/2024 02:54 AM
Hi,
We have a requirement to use the API key as the auth type to get the API response.
Is it possible to use API key as an auth type in the REST connection JSON?
I have found the below connection JSON in the Documentation will it work?
{
"authentications": {
"acctAuth": {
"authType": "cookies",
"url": "",
"httpMethod": "POST",
"httpParams": {
"username": "<specify username>",
"password": "<specify password>",
"apiKey": "${apiKey}",
"timestamp": "${timestamp}"
},
"httpHeaders": {
"contentType": "application/json"
},
"cookies": "${cookies}",
"properties": {
"apiKey": "${apiKey}"
},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"SESSION_NOT_VALID",
"AuthenticationFailed",
"HTTP error code : 401"
],
"timeOutError": "Read timed out",
"errorPath": "code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "",
"tokenType": "",
"accessToken": "<specify access token>",
"retryFailureStatusCode": [
500,
502,
401
]
}
}
}
We are not using any username and password what should add in place of
"username": "<>",
"password": "<>",
"apiKey": "${apiKey}",
"timestamp": "${timestamp}"
Best Regards,
Aditya Chadde
08/21/2024 02:58 AM
Hi @adityachadde , of you don't have the values just leave them.
08/21/2024 06:09 AM
Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]
⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️
08/21/2024 06:58 AM
Hi,
Getting below in Curl command:
curl --location 'https:URL/users/' \
--header 'Api-Key: ************' \
--header 'Cookie: ******************************************'
Best Regards,
Aditya Chadde
08/21/2024 07:00 AM
Keep username and password as blank
08/21/2024 08:02 AM - edited 08/21/2024 10:28 AM
@adityachadde use below and apikey pass it in accestoken and test it
{
"authentications": {
"acctAuth": {
"authType": "cookies",
"httpMethod": "POST",
"httpParams": {},
"httpHeaders": {
"contentType": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"FAILURE",
"INVALID_SESSION_ID"
],
"timeOutError": "Read timed out",
"errorPath": "errors.type",
"retryFailureStatusCode": [
401,403
],
"maxRefreshTryCount": 5,
"tokenResponsePath": "sessionId",
"tokenType": "Basic",
"accessToken": "XXX"
}
}
}