Skip to content

Connectors - Scripted API

Scripted API connectors are ICF connectors based on a proprietary connector called Scripted API. The Scripted API connector is a generic connector that provides utility functions that can be used in Groovy scripts to create specific ICF connectors. These connectors can be easily customized to meet the business needs of each organization. This can be done through a built-in graphical interface in RAC/M Identity.

Prerequisites

  • RAC/M Identity 3.17 or newer
  • A data repository accessible via an API (e.g., Workday)

Script Creation

This step involves creating a Groovy script that will be used by the Scripted API connector.

  1. In the menu bar, click CONFIGURATION > Script Files.
  2. Click on the script name corresponding to the desired connector, starting with "reference-scripts/scripted-api-". This will open the script. For example, to create a connector for Workday, select the script reference-scripts/scripted-api-1.0.0.1/workday.groovy. Choose the latest version available. If the connector does not already exist, you can create one based on the reference scripts.
  3. Click the Duplicate button in the bottom right corner of the screen to create a copy of the script. This will keep the reference script intact.
  4. In the window that appears, give the script an appropriate name and click Duplicate.
  5. (If needed) Modify it to meet your specific requirements. Make sure to regularly save your changes to avoid losing them.
  6. Click Save to save the script.

Connector Creation

This step involves creating a Scripted API connector that will use the script created earlier. First, follow the steps for creating a connector in the ICF Connector Configuration. Select Scripted API as the connector type. Use the same version as the one used for the script.

Connector Configuration

The following parameters are available for configuring the Scripted API connector.

Only fields marked with an asterisk are mandatory. However, some parameters may be required by your specific connector. Please refer to its documentation for more details.

ConfigurationDescription
Script PathPath to the Groovy script created earlier.
API URLThe URL of the API to connect to.
TimeoutTimeout in milliseconds.
Preferred Authentication MethodAuthentication method to use ("password", "bearer", "userToken", or "oauth2").
Authentication URLThe URL used for authentication.
Custom Config 1 to 5Custom configurations that can be used by the script/.
UsernameThe username to use for authentication.
PasswordThe password to use for authentication.
User TokenThe user token to use for authentication.
Bearer TokenThe bearer token to use for authentication.
Custom Secret 1 à 5Customized secrets that can be used by the script, encrypted and handled securely.
Thread Pool SizeThe number of threads to be used for concurrent operations. Leave empty to use all available threads.
Time between retriesThe waiting time before an HTTP request is retried. Leave empty to use 500ms.

Troubleshooting

In the event of an error, check that the configuration is correct, that the script is valid and that the API is accessible. You can also consult the logs for more details on the error. (voir View log files).

Technical aspects

The best way to understand how the Scripted API connector works is to consult the reference scripts. These contain comments that explain how it works. Similarly, it's best to develop a new connector based on the reference scripts.

Data schema

The data schema used by Scripted API connectors consists of "ScriptedAPIObjectClass". Each "ScriptedAPIObjectClass" contains "ScriptedAPIAttribute" which are used to represent the attributes of an object. For example, a Workday user is represented by a "WorkerObjectClass" containing the attributes "EMPLOYEE_ID", "FIRST_NAME", "LAST_NAME", etc.

Functions

The Scripted API connector communicates with the Groovy script by calling certain functions by name. The script must therefore contain certain functions in order to function correctly.

The following functions must be implemented:

FunctionDescription
testTest connection.
schemaReturns the data schema.
searchSearchs for objects.
createCreates an object.
updateUpdates an object.
deleteDeletes an object.
addAttributeValuesAdds values to an object attribute.
removeAttributeValuesDeletes attribute values from an object.

For parameters and examples of how to implement these functions, please refer to the reference scripts.

Librairies

The following libraries are included in the Scripted API connector and can be used by scripts:

LibrairieUtilisation
connid-connector-frameworkICF connector framework.
okhttpHTTP requests.
org.jsonJSON Handling.