06/01/2023 07:40 AM - last edited on 02/29/2024 09:18 AM by Dave
Hi,
I am working on calling a simple PS.1 script that is placed under a folder in a windows server. I have installed the IIS and Saviynt Agent as per doc (https://docs.saviyntcloud.com/bundle/WinPS-v55x/page/Content/Understanding_the_Integration-between-E.... Now that the create account task is triggered and the task is completed successfully BUT the PS.1 script does not run at all. In the logs I just see a one liner error: 2023-06-01 14:26:29,984 [quartzScheduler_Worker-3] ERROR rest.RestProvisioningService - Access Token is null..
I have also added a "null" response in the unsuccessResponses but somehow the task is always completed successfully even after getting no response back.
The same if I try via Postman the script runs and I get a 200 response code status. Not sure what I am missing here. Please help!
My connection and account JSON details:
{
"authentications": {
"acctAuth": {
"authType": "Basic",
"url": "http://XXXXXX.com/SaviyntApp/PS/ExecutePSScript",
"httpMethod": "POST",
"httpParams": {},
"httpHeaders": {
"Accept": "application/json"
},
"httpContentType": "application/json",
"properties": {
"userName": "MTESTNET\\IAM_EXCHANGE_svc",
"password": "xxxx"
},
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"Authentication_MissingOrMalformed",
"Authentication_ExpiredToken"
],
"retryFailureStatusCode": [
403,
401,
500
],
"timeOutError": "Read timed out",
"errorPath": "errors.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "token",
"tokenType": "Basic",
"accessToken": "Basic abcd"
}
}
}
{
"accountIdPath": "accountName",
"responseColsToPropsMap": {},
"call": [{
"name": "call1",
"connection": "userAuth",
"showResponse": true,
"url": "http://XXXXXXXX.com/SaviyntApp/PS/ExecutePSScript",
"httpMethod": "POST",
"httpParams": "{\"Script\":\"Powershell.exe -File D:\/test\/run.ps1 \"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses":[
{
"message": "ProfileID Created Successfully"
},
{
"message": "ProfileID Updated Successfully"
}
],
"unsuccessResponses": {
"statusCode": [
400,
401,
null
]
}
}]
}
Attached are the logs.
Solved! Go to Solution.
06/02/2023 02:01 PM - edited 06/02/2023 02:01 PM
I see you have defined the value as "connection": "userAuth" in your Create account JSON where as you defined the name as 'acctAuth' in your Connection JSON. Can you update this and validate.