Example connector using RCS
Use the CSV connector to reconcile users in a remote CSV data store
This example shows reconciliation of users stored in a CSV file on a remote machine. The remote Java RCS lets IDM synchronize its repository with the remote CSV file.
The example assumes that a remote Java RCS is installed and running on a host named remote-host
.
The example uses the small CSV data set provided with the Getting Started sample (hr.csv
). The CSV connector runs as a remote connector on the host where the Java RCS is running. Before you start, copy the CSV data file from the Getting Started sample (/path/to/openidm/samples/getting-started/data/hr.csv
) to an accessible location on the machine that hosts the remote Java RCS. For example:
cd /path/to/openidm/samples/getting-started/data/ scp hr.csv testuser@remote-host:/home/testuser/csv-sample/data/ Password:** hr.csv 100% 651 0.6KB/s 00:00
Configure IDM for the remote CSV connector example
-
Copy the following files to your
/path/to/openidm/conf
directory:- sync.json
-
A customized mapping file for this example.
/openidm/samples/example-configurations/provisioners/provisioner.openicf.connectorinfoprovider.json
-
A sample RCS configuration.
/openidm/samples/example-configurations/provisioners/provisioner.openicf-csvfile.json
-
A sample connector configuration file.
-
Edit the RCS configuration file (
provisioner.openicf.connectorinfoprovider.json
) to match your network setup.The following example indicates that the Java RCS is running on the host
remote-host
, listening on the default port, and configured with a secret key ofPassw0rd
:{ "remoteConnectorServers" : [ { "name" : "csv", "host" : "remote-host", "port" : 8759, "usessl" : false, "key" : "Passw0rd" } ] }
The
name
you set in this file will be referenced in theconnectorHostRef
property of the connector configuration in the next step.The
key
you specify here must match the password you set when you installed the Java RCS. -
Edit the CSV connector configuration file (
provisioner.openicf-csvfile.json
) as follows:{ "connectorRef" : { "connectorHostRef" : "csv", "bundleName" : "org.forgerock.openicf.connectors.csvfile-connector", "bundleVersion" : "[1.5.0.0,1.6.0.0)", "connectorName" : "org.forgerock.openicf.csvfile.CSVFileConnector" }, ... "configurationProperties" : { "csvFile" : "/home/testuser/csv-sample/data/hr.csv" } }
-
The
connectorHostRef
property sets the RCS to use, and refers to thename
property you specified in theprovisioner.openicf.connectorinfoprovider.json
file. -
The
bundleVersion : "[1.5.0.0,1.6.0.0)",
must either be exactly the same as the version of the CSV connector that you are using or, if you specify a range, the CSV connector version must be included in this range. -
The
csvFile
property must specify the absolute path to the CSV data file that you copied to the remote host on which the Java RCS is running.
-
Run the remote CSV connector example
-
Start IDM:
/path/to/openidm/startup.sh
-
Verify that IDM can reach the RCS, and that the CSV connector has been configured correctly:
curl \ --header "X-OpenIDM-Username: openidm-admin" \ --header "X-OpenIDM-Password: openidm-admin" \ --header "Accept-API-Version: resource=1.0" \ --request POST \ "http://localhost:8080/openidm/system?_action=test" [ { "name": "csv", "enabled": true, "config": "config/provisioner.openicf/csv", "objectTypes": [ "__ALL__", "account" ], "connectorRef": { "bundleName": "org.forgerock.openicf.connectors.csvfile-connector", "connectorName": "org.forgerock.openicf.csvfile.CSVFileConnector", "bundleVersion": "[1.5.0.0,1.6.0.0)" }, "displayName": "CSV File Connector", "ok": true } ]
The connector must return
"ok": true
.Alternatively, use the admin UI to verify that IDM can reach the RCS and that the CSV connector is active. Log in to the admin UI (
https://localhost:8443/openidm/admin
), and select Configure > Connectors. The CSV connector should be listed on the Connectors page, and its status should be Active.Figure 1. Connectors Tab Showing an Active CSV Connector -
To test that the connector has been configured correctly, run a reconciliation operation as follows:
-
Select Configure > Mappings, and click the systemCsvAccounts_managedUser mapping.
-
Click Reconcile.
If the reconciliation is successful, the three users from the remote CSV file should have been added to the managed user repository.
To check this, click Manage > User.
-