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

Create account configuration - Pre Validation Call

itinjic
Regular Contributor
Regular Contributor

Hello,

One system is logically divided into several endpoints in Saviynt. If a user has an account in one endpoint and request access to another endpoint (of same target system), create account task and add access task are created in Saviynt. Since the user already has an account in the target system then that system return 409 (Duplicate entry) error code when the create account action is executed.

Can we check first if account already exist and then depending on the response decide whether the call for creation will be executed?

Something like this code below, can we have an IF statement in the configuration?

"call": [
{
  "name": "call1",
  "callOrder": 0,
  "connection": "acctAuth",
  "url": "https://app.test.com/api/Users/?filter=emails%20eq%20%22${user.email}%22",
  "httpMethod": "GET",
  "httpHeaders": {
    "Authorization": "Bearer ${access_token}",
    "Accept": "application/json"
  },
  "httpContentType": "application/json",
  "successResponses": {
    "statusCode": [200, 204]
  }
},
{
  "name": "call2",
  "callOrder": 1,
  "connection": "acctAuth",
  "url": "https://app.test.com/api/Users",
  "httpMethod": "POST",
  "httpParams": "{\"name\":{\"familyName\":\"${user.lastname}\",\"givenName\":\"${user.firstname}\"},\"active\":true}",
  "httpHeaders": {
    "Authorization": "Bearer ${access_token}",
    "Accept": "application/json"
  },
  "httpContentType": "application/json",
  "successResponses": {
    "statusCode": [200, 201, 409]
  },
  "if": "response.call1.message.totalResults == 0"
}
]
Sapere aude
3 REPLIES 3

NM
Honored Contributor III
Honored Contributor III

@itinjic 2 possible solution 

1) do a get call in create account json get the identity and map id it doesn't exist create one.

2) mapped endpoint configuration in endpoint will also fullfill your requirement.


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

itinjic
Regular Contributor
Regular Contributor

For this 1) do a get call in create account json get the identity and map id it doesn't exist create one.

How to check this  map id it doesn't exist create one?

Please look the code I wrote 


Sapere aude

NM
Honored Contributor III
Honored Contributor III

@itinjic call 2 connection 

  "connection":" ${(response.call1.message.totalResults==0)?'acctAuth' :'' }"

Try this 


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