You can use scripting to modify default ForgeRock Identity Cloud behavior in many situations: client-side authentication, policy conditions, handling OpenID Connect claims, and others.
To manage your scripts, go to Realm > Scripts.
On the scripts page you can view a list of existing scripts. To edit, duplicate, or delete a script, click its More () menu.
The edit option in the More menu will open the script in a lightweight editor which features syntax highlighting and validation checking. You can maximize the editor to full screen to assist the editing of larger scripts:
To create a new script:
Go to Realm > Scripts, then click + New Script.
Choose a script type:
Script Type Description
Scripts that are executed on the client during authentication.
Journey Decision Node
Scripts that are included in an authentication node within a journey, and are executed on the server during authentication.
Scripts that are used as conditions within policies.
Scripts that gather and populate the claims in a request when issuing an ID token or making a request to the userinfo endpoint.
OAuth 2.0 Access Token Modification
Scripts that modify the key-value pairs contained within access tokens before they are issued to a client.
OAuth 2.0 "May Act"
Scripts that can add the
may_actclaim to tokens when performing token exchanges.
Social Identity Provider Profile Transformation
Scripts that adapt the fields received by a social identity provider to align with the fields expected by Identity Cloud.
After you select a script type, the editor will open. The editor is prepopulated with a default script for that type, which is intended as a starting point for your custom script.
If you selected the wrong script type, click Previous to repeat step 2 and select a different script type.
Enter a unique name for the script, then click Save.
The script type is fixed for the lifetime of the script when the script is saved.
See Journeys for more information on journeys.
You can create, edit, and validate journey decision node scripts directly from within a scripted decision node in a journey.
Go to Realm > Journeys.
Open a journey in the journey editor.
Find an existing scripted decision node or add a new one.
Select the scripted decision node to open the context pane on the right side.
The following screenshot shows where you can create a new journey decision node script (4) or edit an existing one (5):
|1||Scripted decision node|
|3||Journey decision node script dropdown|
|4||Add new journey decision node script|
|5||Edit existing journey decision node script|