Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/31/2024 11:02 AM - last edited on 05/31/2024 01:27 PM by Dave
Hi Team,
We are trying to grab the access token from our API response, but it does not have a path. IE the body of the response that contains the token is: "TOKEN". We have tried string.content, token, and leaving it blank. I have validated that it works if I grab the token from postman and put it under the accessToken. below is our connection JSON.
{
"authentications":{
"acctAuth":{
"authType":"oauth2",
"httpHeaders":{
"Accept":"application/xml",
"contentType":"application/json"
},
"authError":[
"PASWS013E"
],
"url":"https://<HOSTNAME>/PasswordVault/API/auth/cyberark/Logon",
"httpMethod":"POST",
"httpContentType":"application/json",
"errorPath":"ErrorCode",
"maxRefreshTryCount":5,
"cleanUpTextContent": true,
"tokenResponsePath":"sessionId",
"accessToken":"$access_token",
"httpParams":"{\"username\":\"USERNAME\",\"password\":\"PASSWORD\"}",
"retryFailureStatusCode":[
401,
403
],
"testConnectionParams":{
"http":{
"url":"https://<hostname>/PasswordVault/API/Accounts/?limit=1&access_Token=$access_token",
"httpHeaders":{
"contentType":"application/json"
},
"httpContentType":"application/json",
"httpMethod":"GET"
}
}
}
}
}
To Add I have also tried sessionId from the rest developer handbook.
Thanks,
Brandon
[This post has been edited by a Moderator to merge two posts.]
06/03/2024 08:06 PM
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.‼️‼️⚠️
06/04/2024 06:36 AM - edited 06/04/2024 06:37 AM
06/04/2024 07:51 AM
{
"authentications":{
"acctAuth":{
"authType":"oauth2",
"httpHeaders":{
"Accept":"application/xml",
"contentType":"application/json"
},
"authError":[
"PASWS013E"
],
"url":"https://<HOSTNAME>/PasswordVault/API/auth/cyberark/Logon",
"httpMethod":"POST",
"httpContentType":"application/json",
"errorPath":"ErrorCode",
"maxRefreshTryCount":5,
"cleanUpTextContent": true,
"tokenResponsePath":"",
"accessToken":"acc",
"httpParams":"{\"username\":\"USERNAME\",\"password\":\"PASSWORD\"}",
"retryFailureStatusCode":[
401,
403
],
"testConnectionParams":{
"http":{
"url":"https://<hostname>/PasswordVault/API/Accounts/?limit=1&access_Token=$access_token",
"httpHeaders":{
"contentType":"application/json"
},
"httpContentType":"application/json",
"httpMethod":"GET"
}
}
}
}
}
06/04/2024 01:19 PM
We have tried leaving the tokenResponsePath blank as above and tried with your JSON. It does not pick up the token. Below is a screenshot from the logs where it is writing acc (accessToken in JSON) as the token in the URL.
Thanks,
Brandon
06/04/2024 07:17 PM
{
"authentications":{
"acctAuth":{
"authType":"oauth2",
"httpHeaders":{
"Accept":"application/xml",
"contentType":"application/json"
},
"authError":[
"PASWS013E"
],
"url":"https://<HOSTNAME>/PasswordVault/API/auth/cyberark/Logon",
"httpMethod":"POST",
"httpContentType":"application/json",
"errorPath":"ErrorCode",
"maxRefreshTryCount":5,
"cleanUpTextContent": true,
"tokenResponsePath":"string.content",
"accessToken":"acc",
"httpParams":"{\"username\":\"USERNAME\",\"password\":\"PASSWORD\"}",
"retryFailureStatusCode":[
401,
403
],
"testConnectionParams":{
"http":{
"url":"https://<hostname>/PasswordVault/API/Accounts/?limit=1&access_Token=$access_token",
"httpHeaders":{
"contentType":"application/json"
},
"httpContentType":"application/json",
"httpMethod":"GET"
}
}
}
}
}
06/05/2024 05:19 AM
06/05/2024 05:35 AM
Remove test connection param and validate
06/05/2024 05:52 AM
Hi @rushikeshvartak ,
Jobs did not work. First screenshot is with string.content second it is left empty (for variable tokenResponsePath).
Thanks,
Brandon
06/05/2024 05:54 AM
Above suggested json is from documentation
06/05/2024 06:00 AM
Hi @rushikeshvartak ,
Yes, that is what we found as well. This seems to be an issue with Saviynt picking up the token if you don't have any other suggestions I will create a FD ticket.
Thanks,
Brandon
06/05/2024 06:00 AM
Add feedback on saviynt doc they will provide working json
06/05/2024 06:03 AM
@rushikeshvartak Thank you I will try that first.
06/05/2024 06:06 AM
06/05/2024 07:49 AM
Hi @rushikeshvartak ,
This forums post looks to be similar to this one and they said that it is not working for the account imports.
Solved: Generate token using cookie in responseText (Conne... - Saviynt Forums - 74310
Thanks,
Brandon
06/05/2024 08:32 PM
Did you tried this one ? @bbuchler
06/06/2024 04:55 AM
No, we have not tried this one since our use cases are for imports which in the post states it does not work for that.
Thanks,
Brandon