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
No ratings
sudeshjaiswal
Saviynt Employee
Saviynt Employee

Use Case

 

The Saviynt REST connector supports Looping operations. Refer following article/example to understand how it can be configured.
 

Pre-requisites

 
Rest Connection

Applicable Version(s)


All
 

Solution

 

In the REST connector provisioning JSONs, javascript operations such as ternary conditions, FOR loop, and string operations are applied on attribute values as per requirement. For example, “Roles”: [${response.call1.message.roles.toString().replace(‘[’,’’).replace(‘]’,’’).replace(‘,’,’\”,\”’)}]

 

1. Example for JSON with ternary conditions:

 

sudeshjaiswal_0-1686040572781.png

 

2. Example for JSON with string operations:
 
{
"name":"call1",
"connection":"userAuth",
"url":"${requestAccessAttributes.addRemoveAlias==null?'https://<domain name>/admin/directory/v1/users/'+account.name:account.customproperty30.toString().contains(requestAccessAttributes.addRemoveAlias)?'https://<domain name>/admin/directory/v1/users/'+account.name+'/aliases/'+requestAccessAttributes.addRemoveAlias.trim():'https://<domain name>/admin/directory/v1/users/'+account.name+'/aliases'}",
"httpMethod":"${requestAccessAttributes.addRemoveAlias==null?'PUT':account.customproperty30.toString().contains(requestAccessAttributes.addRemoveAlias)?'DELETE':'POST'}",
"httpParams":"${requestAccessAttributes.addRemoveAlias==null?'{\"name\":{\"familyName\":\"'+user.firstname+'\",\"givenName\":\"'+user.lastname+'\"},\"password\":\"password\",\"primaryEmail\":\"'+account.name+'\",\"orgUnitPath\":\"/\"}':account.customproperty30.toString().contains(requestAccessAttributes.addRemoveAlias)?'{}':'{\"alias\": [\"'+requestAccessAttributes.addRemoveAlias.trim()+'\"]}'}",
"httpHeaders":{
"Authorization":"${access_token}",
"Content-Type":"application/json"
},
"httpContentType":"application/json",
"successResponses":{
"statusCode":[
200,
201,
2014
]
}
}

 

3. Example for JSON with FOR Loop:

{
"call":[
{
"name":"Group",
"connection":"userAuth",
"url":"https://<domain name>/sys_user_grmember?user=${account.accountID}",
"httpMethod":"GET",
"httpHeaders":{
"Authorization":"${access_token}"
},
"httpContentType":"application/json",
"successResponses":{
"statusCode":[
200
]
},
"unsuccessResponses":{
"statusCode":[
400
]
}
},
{
"name":"Group",
"connection":"userAuth",
"url":"https://<domain name>/sys_user_grmember/${for (Map map : response.Group1.message.result){if (map.group.value.toString().equals(entitlementValue.entitlementID)){return map.sys_id;}}}",
"httpMethod":"DELETE",
"httpHeaders":{
"Authorization":"${access_token}"
},
"httpContentType":"application/json",
"successResponses":{
"statusCode":[
204
]
},
"unsuccessResponses":{
"statusCode":[
400
]
}
}
]
}

 

Version history
Last update:
‎06/10/2023 05:25 AM
Updated by:
Contributors