Web Services Before/After Connector Rules: Intercept HTTP Operation

Dear SailPoint Community,

I’m trying to wrap my head around the Web Services Connector Rules.

Is it possible to intercept an HTTP Operation configured for the Web Service Connector call and return some static data for it?
If so, is it maybe possible to do it in the Before rule, so that the call is not performed at all?

If not, is it possible only in the After Rule, so that a call has to be performed and the returned that has to be discarded/overwritten with the static info? The After rules don’t execute if there was an error, right? I couldn’t find this information specified in the documentation.

What I am trying to achieve: provide the Group/Entitlement information for the Group Aggregation operation even if the endpoint doesn’t provide that information itself.
I’ve also tried to use a “curl” command like echo [{"id": 1, "name": "Entitlement A", ...}] but that doesn’t seem to work.

Best regards,
Andrei

I have used an After Rule for such a case. For the HTTP Operation, I used the same API information that I used on the Test Connection. Then added the After Rule to add the static information.

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

List finallist = new ArrayList();
Map newmap = new HashMap();
Map updatedMapInfo = new HashMap();
//create Entitlement A
newmap.put("name", "Entitlement A");
newmap.put("id", 1);
newmap.put("description", "Description for Entitlement A");
//Add Entitlement A to finallist Array
finallist.add(newmap);
//clear newmap
newmap = new HashMap();
//create Entitlement B
newmap.put("name", "Entitlement B");
newmap.put("id", 2);
newmap.put("description", "Description for Entitlement B");
//Add Entitlement B to finallist Array
finallist.add(newmap);
updatedMapInfo.put("data", finallist);
return updatedMapInfo;
1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.