Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

How to use the API key Authentication in Saviynt REST connection JSON

adityachadde
New Contributor III
New Contributor III

Hi,

We have a requirement to use the API key as the auth type to get the API response.

adityachadde_0-1724233745148.png

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

5 REPLIES 5

NM
Honored Contributor II
Honored Contributor II

Hi @adityachadde , of you don't have the values just leave them.

rushikeshvartak
All-Star
All-Star

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.‼️‼️⚠️


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hi,

 

Getting below in Curl command:

curl --location 'https:URL/users/' \
--header 'Api-Key: ************' \
--header 'Cookie: ******************************************'

 

Best Regards,

Aditya Chadde

Keep username and password as blank


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Raghu
All-Star
All-Star

@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"
}
}
}


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.