Click HERE to see how Saviynt Intelligence is transforming the industry. |
01/23/2024 04:30 PM
We are calling an existing script with some arguments on the IIS Server. Hardcoding values executes the script but with variables it does not work, either it thinks value is null or is not resolving the variable. Have tried backslashes to escape quotes but no luck. Below is the createaccountJSON:
{
"accountIdPath": "accountName",
"responseColsToPropsMap": {},
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "http://xx.xx.xx/SaviyntApp/PS/ExecutePSScript",
"httpMethod": "POST",
"httpParams": "{\"Script\": \"F:\/scripts\/MailEnableUser.ps1 '${userName}' '${password}' '${user.email}' '${task.accountName}' \"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/x-www-form-urlencoded",
"SuccessResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
404,
405,
500
]
}
}
]
}
Solved! Go to Solution.
01/23/2024 04:37 PM
Replace username to user.username
01/24/2024 06:52 AM
Actually that is the username and password from connection JSON not the user's. Issue seems in general with the variables, syntax is wrong for some reason but we cannot determine where.
01/24/2024 11:54 AM
Connection json ?
then it should be ${connection.username}
01/25/2024 07:10 AM
{
"authentications": {
"userAuth": {
"authType": "Basic",
"url": "http://xx.xx.xx.corp/SaviyntApp/PS/ExecutePSScript",
"httpMethod": "POST",
"httpParams": {},
"httpHeaders": {},
"httpContentType": "text/html",
"properties": {
"userName": "xx",
"password": "xx"
},
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Basic",
"accessToken": "Basic xxx",
"testConnectionParams": {
"http": {
"url": "http://xx.xx.xx.corp/SaviyntApp/PS/ExecutePSScript",
"httpMethod": "POST",
"requestBody": "",
"httpParams": {},
"httpHeaders": {
"contentType": "application/json",
"Authorization": "${accessToken}"
},
"httpContentType": "application/json"
},
"successResponse": [],
"successResponsePath": "responseText",
"errors": [
"fail",
"error",
"false"
],
"errorPath": "responseText"
}
}
}
}
Using ${connection.username} does not work, getting a username/password error there. Looks like ${userName} and ${password} work, but ${user.email} and ${task.accountName} is causing the error. I have attached the error.
01/25/2024 01:23 PM
This was resolved by using the following variables instead of ${userName} and ${password} or ${connection.username} and ${connection.password}:
'${connection.exchUser}' '${connection.exchPassword}'
01/25/2024 01:31 PM
I have mentioned same thing