Hello everyone,
I’m implementing a BeforeOperationRule to retrieve a SAS CAS ticket in order to invoke stored processes.
The first HTTP call must retrieve the Location header returned by the CAS ticket endpoint.
{SAS004}
When executed from SailPoint, the system returns HTTP 403.
The exact same call works correctly using Bruno.
Below is the full code used in the rule.
Do you see any issues or limitations with this approach?
String casTicketsUrl = "https://xxxx.ondemand.sas.com/SASLogon/v1/tickets";
String serviceUrl = application.getAttributeValue("genericWebServiceBaseUrl");
String user = application.getAttributeValue("username");
String pass = application.getAttributeValue("password");
Map args = new HashMap();
args.put(WebServicesClient.ARG_URL, casTicketsUrl);
restClient.configure(args);
Map tgtHeaders = new HashMap();
tgtHeaders.put("Content-Type", "application/x-www-form-urlencoded");
List allowedstatus = new ArrayList();
allowedstatus.add("2**");
Map payLoad = new LinkedHashMap();
payLoad.put("username", URLEncoder.encode(user, "UTF-8"));
payLoad.put("password", URLEncoder.encode(pass, "UTF-8"));
if (Util.isNullOrEmpty(casTicketsUrl) || Util.isNullOrEmpty(serviceUrl) ||
Util.isNullOrEmpty(user) || Util.isNullOrEmpty(pass)) {
throw new RuntimeException("CAS configuration missing on application");
}
log.error("Starting the HTTP calls");
String tgtResponse = restClient.executePost(
casTicketsUrl,
payLoad,
tgtHeaders,
allowedstatus
);
Thanks in advance for any help or shared experience.