---
title: Scripting
description: Extend PingIDM with custom scripts, triggers, endpoints, and JavaScript or Groovy logic
component: pingidm
version: 8
page_id: pingidm:scripting-guide:preface
canonical_url: https://docs.pingidentity.com/pingidm/8.1/scripting-guide/preface.html
llms_txt: https://docs.pingidentity.com/pingidm/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
keywords: ["Scripting"]
page_aliases: ["index.adoc"]
superseded_by: https://docs.pingidentity.com/pingidm/8.1/scripting-guide/preface.html
section_ids:
  rhino: Rhino
  groovy: Groovy
  lodash_and_handlebars: Lodash and Handlebars
  bouncycastle: BouncyCastle
  name_changes_for_forgerock_products: Name changes for ForgeRock products
---

# 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.

[icon: terminal, set=fad, size=3x]

#### [Call a Script](script-call.html)

Call a script from the IDM configuration using inline source or a file reference.

[icon: cogs, set=fad, size=3x]

#### [Script Configuration](script-config.html)

Modify the parameters to compile, debug, and run scripts.

[icon: wrench, set=fad, size=3x]

#### [Custom Endpoints](script-custom-endpoints.html)

Run arbitrary scripts through the REST URI.

[icon: play-circle, set=fad, size=3x]

#### [Script Triggers](script-triggers.html)

Learn where and how you can trigger scripts.

[icon: file-code, set=fad, size=3x]

#### [Script Variables](script-vars.html)

Learn about the variables available to scripts.

[icon: book, set=fad, size=3x]

#### [Scripting Function Reference](scripting-func-ref.html)

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 *(tooltip: You can manage the script configuration over REST at the config/script endpoint, or directly in the conf/script.json file.)*.Default scripts are located in (`/path/to/openidm/bin/defaults/script/`). Do not modify the scripts in this directory. Rather, copy the default scripts to a different location, make the changes, and update the referenced scripts in the applicable `conf/` file. You can put custom scripts in any of the locations referenced in the `sources` property in `conf/script.json`. |

## Rhino

Rhino runs JavaScript. Rhino has limited support for ES6 / ES2015 (JavaScript version 1.7). For more information, refer to [Rhino ES2015 Support](https://mozilla.github.io/rhino/compat/engines.html).

|   |                                                                                                                                            |
| - | ------------------------------------------------------------------------------------------------------------------------------------------ |
|   | 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:

```javascript
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:- **Lodash**: Check the version comment at the top of `openidm/bin/defaults/script/lib/lodash.js`.

- **Handlebars**: Locate the `handlebars-<version>.jar` file in the `openidm/bundle` directory. |

## 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](https://github.com/bcgit/bc-java/issues/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. |

## Name changes for ForgeRock products

Product names changed when ForgeRock became part of Ping Identity.

The following name changes have been in effect since early 2024:

| Old name                      | New name                        |
| ----------------------------- | ------------------------------- |
| ForgeRock Identity Cloud      | PingOne Advanced Identity Cloud |
| ForgeRock Access Management   | PingAM                          |
| ForgeRock Directory Services  | PingDS                          |
| ForgeRock Identity Management | PingIDM                         |
| ForgeRock Identity Gateway    | PingGateway                     |

Learn more about the name changes in [New names for ForgeRock products](https://backstage.forgerock.com/knowledge/kb/article/a64386714) in the Knowledge Base.
