Expose a Form to an external Link

So what I’d do is create a QuickLink that launches the workflow you want to launch.

Then, create a small JSP page that does the following:

  • Check user authorization to be accessing the page at all and redirect to home.jsf if not authorized.
  • Check user authorization to use the QuickLink, which you can do via the LcmRequestAuthorizer class. Again, redirect to home.jsf if not authorized.
  • Use the sailpoint.service.quicklink.QuickLinkLauncher service to cause IIQ to act as though the user had clicked the QuickLink. If a form results from the workflow launch, redirect the user.

Here is how you do that in a REST API. You’d have to adapt it for JSP, but you still have access to all the same objects, including the HTTP session.

// launcher is an Identity representing the logged in user
QuickLinkLauncher api = new QuickLinkLauncher(getContext(), launcher);

// Fake session map for storing the output
Map<String, Object> session = new HashMap<>();

// These are the IDs passed to the Workflow as quicklinkIdentityIds. In this case, it's a 'self' launch.
List<String> ids = new ArrayList<>();
ids.add(launcher.getId());

QuickLinkLaunchResult result = api.launchWorkflow(ql, launcher.getId(), ids, session);
if (session.containsKey("workItemFwdNextPage")) {
    // If we get here, a work item has been created. Load all of the state into the user's browser session.
    for (Object key : session.keySet()) {
	getSession().setAttribute((String)key, session.get(key));
    }

    // Fetch the base URL
    Configuration systemConfig = Configuration.getSystemConfig();
    String baseUrl = (String)systemConfig.get(SYSTEM_CONFIG_SERVER_ROOT_PATH);
    
    // Redirect to this URL - you'd do this using JSP response.sendRedirect instead
    response.put(RESPONSE_PARAM_REDIRECT, baseUrl + "/workitem/commonWorkItem.jsf#/commonWorkItem/session");
}

When the user is redirected to the commonWorkItem.jsf, the session data injected by the QuickLinkLauncher will cause it to display your form.

2 Likes