Scripting
Scripting lets you extend IDM functionality. For example, you can provide custom logic between source and target mappings, define correlation rules, filters, triggers, and so on. This guide shows you how to use scripts in IDM and provides reference information on the script engine.
Call a Script
Call a script from the IDM configuration using inline source or a file reference.
Script Configuration
Modify the parameters to compile, debug, and run scripts.
Custom Endpoints
Run arbitrary scripts through the REST URI.
Script Triggers
Learn where and how you can trigger scripts.
Script Variables
Learn about the variables available to scripts.
Scripting Function Reference
Reference for openidm object methods, global utility functions, and logger functions available to scripts.
IDM supports scripts written in JavaScript and Groovy, and bundles the following libraries to support scripting.
|
Script options and locations are defined in the script configuration. Default scripts are located in ( |
Rhino
Rhino runs JavaScript. Rhino has limited support for ES6 / ES2015 (JavaScript version 1.7). For more information, refer to Rhino ES2015 Support.
To find the Rhino version bundled with your instance, locate the org.mozilla.rhino-<version>.jar file in the openidm/bundle directory.
|
Groovy
Groovy provides Groovy script support.
To find the Groovy version bundled with your instance, locate the groovy-<version>.jar file in the openidm/bundle directory.
|
Lodash and Handlebars
IDM bundles Lodash and Handlebars for Rhino scripting.
Using Handlebars JS in server-side JS scripts requires synchronization; for example:
var Handlebars = require("lib/handlebars");
var result = new Packages.org.mozilla.javascript.Synchronizer(function() {
var template = Handlebars.compile("Handlebars {{doesWhat}}");
return template({ doesWhat: "rocks!" });
}, Handlebars)();
console.log(result);
|
To find the version bundled with your instance:
|
BouncyCastle
IDM bundles BouncyCastle for signing JWTs.
The IDM-bundled BouncyCastle .jar includes the unused org.bouncycastle.asn1.util.Dump command-line utility. Don’t reference it in your scripts. Learn more in BouncyCastle issue 634.
|
To find the BouncyCastle version bundled with your instance, locate the bcprov-<version>.jar or bcpkix-<version>.jar file in the openidm/bundle directory.
|
ForgeRock Identity Platform™ serves as the basis for our simple and comprehensive Identity and Access Management solution. We help our customers deepen their relationships with their customers, and improve the productivity and connectivity of their employees and partners. For more information about ForgeRock and about the platform, refer to https://www.forgerock.com.
The ForgeRock Common REST API works across the platform to provide common ways to access web resources and collections of resources.