Hi team,
I have a Web Service connector with Update Account configured for multiple attributes. Some of these attributes are directly linked to the Identity Profile, and are getting synced immediatly after changes in the authoritative source. However, some of these attributes that only exist on the source account are not being updated automatically, as the update operation isn’t being triggered.
Sometimes, some of these attributes are synced, but very rarely. I’m not sure what is causing this inconsistency, but all attributes are definately not syncing to the web service source.
I have configured an AfterRule with all the logic to send my update provisioning policy:
if (provisioningPlan != null) {
log.error("provvPlan" + provisioningPlan.getAccountRequests().get(0).getAttributeRequests());
List attrReqs = provisioningPlan.getAccountRequests().get(0).getAttributeRequests();
StringBuilder jsonBodyBuilder = new StringBuilder("[\n");
for (i = 0; i < attrReqs.size(); ++i) {
log.error("provvList: " + attrReqs.get(i).getValue() + " - " + attrReqs.get(i).getName());
String attr = attrReqs.get(i).getName();
String value = attrReqs.get(i).getValue();
String itemJsonBody = "";
// Update the contents of the if-statement when adding/removing attributes to the provisioning plan
if (attr.equals("description")) {
// Build JSON body for each item in the list
itemJsonBody =
"{\n" +
" \"op\": \"replace\",\n" +
" \"path\": \"/" + attr + "\",\n" +
" \"value\": \"" + value + "\"\n" +
"}";
} else if (attr.equals("employmentDate")) {
// Build JSON body for each item in the list
itemJsonBody =
"{\n" +
" \"op\": \"replace\",\n" +
" \"path\": \"/userStatus\",\n" +
" \"value\": {\n" +
" \"dateFrom\": \"" + value + "\"\n" +
" }\n" +
"}";
} else if (attr.equals("expiredDate")) {
// Build JSON body for each item in the list
itemJsonBody =
"{\n" +
" \"op\": \"replace\",\n" +
" \"path\": \"/userStatus\",\n" +
" \"value\": {\n" +
" \"dateTo\": \"" + value + "\"\n" +
" }\n" +
"}";
} else if (attr.equals("status")) {
// Build JSON body for each item in the list
itemJsonBody =
"{\n" +
" \"op\": \"replace\",\n" +
" \"path\": \"/userStatus\",\n" +
" \"value\": {\n" +
" \"status\": \"" + value + "\"\n" +
" }\n" +
"}";
}
else {
log.error("Error: String build failed...");
}
jsonBodyBuilder.append(itemJsonBody);
// Add a comma and newline for all items except the last one
if (i < attrReqs.size() - 1) {
jsonBodyBuilder.append(",\n");
}
}
jsonBodyBuilder.append("\n]");
Map body = requestEndPoint.getBody();
body.put("jsonBody", jsonBodyBuilder.toString());
requestEndPoint.setBody(body);
log.error("fullBody: " + body);
} else {
log.info("Rule: plan is null");
}
Yes, this code can be cleaned and we don’t have to duplicate every JSON-body, but for clarity now when debugging I’ll leave it this way.
Description, start & end date has been working decently when there are changes in the authoritative source. However, status is never being synced, as this one only exists in the end system (but of course mapped to the source account profile in IDN as well).
That being said, the code works. Issue seems to be that the update/modify operation isn’t being triggered automatically for attributes that are not mapped directly from the identity profile to the source provisioning plan.
Do I need to configure any extra operations for this? Is this the expected behaviour in IdentityNow?