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/confdirectory:- 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
nameyou set in this file will be referenced in theconnectorHostRefproperty of the connector configuration in the next step.The
keyyou 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
connectorHostRefproperty sets the RCS to use, and refers to thenameproperty you specified in theprovisioner.openicf.connectorinfoprovider.jsonfile. -
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
csvFileproperty 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.
Using the Platform admin UI
-
Sign in to the Platform admin UI (default
https://localhost:8443/platform). -
Verify that IDM can reach the RCS and that the CSV connector is active:
-
From the sidebar, click Provisioners.
-
On the Provisioners page, click the CSV provisioner.
The connection status on the provisioner page displays Connected.
-
-
Click the Advanced Sync tab, and select the
systemCsvAccounts_managedUsermapping. -
Click the Reconcile tab, then click Reconcile Now.
-
Verify the users from the remote CSV file are now in the managed user repository. Click Identities > Manage in the sidebar, and select the Users tab.
The UI displays the users reconciled from the remote CSV file.
Using the legacy admin UI
-
Log in to the legacy admin UI (default
https://localhost:8443/admin). -
Verify that IDM can reach the RCS and that the CSV connector is active. Go to Configure > Connectors.
The Connectors page displays the CSV connector with Active status.
-
Go to Configure > Mappings, and click the systemCsvAccounts_managedUser mapping.
-
Click Reconcile.
-
Verify the users from the remote CSV file are now in the managed user repository. Go to Manage > User.
The UI displays the users reconciled from the remote CSV file.