It may be necessary to set up a remote Java Connector Server (JSC). This section provides directions for setting up the standalone connecter on Unix/Linux and Windows.
Procedure 9.5. Installing a Standalone Connector Server for Unix/Linux
-
Download the OPENICF JAVA Connector Server from the OpenIDM download page under the ForgeRock Open Stack download page.
-
Run the terminal and unpack it. The following command will unzip the file in the current folder, so make sure to move to the appropriate location prior to running the command.
unzip openicf--java.zip
-
Change the directory to OpenICF using the following command:
$ cd path/to/openicf
-
If needed, secure the communication between OpenIDM and JCS. The JCS uses a property called
secret keyto authenticate the connection. The default secret key value ischangeit. To change the value of the secret key enter the following, replacingnewkeywith the your own string value:java - cp "./lib/framework/*" org.identityconnectors.framework.server.Main -setKey -key <newkey> -properties ./conf/ConnectorServer.properties -
Review the
ConnectorServer.propertiesin the/confdirectory, and make changes as necessary. The file contains setting information, including things like ports, the allowance of one/all IP addresses, and SSL. The file provides the required information to update these settings. -
Run the JCS.
java -cp "./lib/framework/*" org.identityconnectors.framework.server.Main -run -properties ./conf/ConnectorServer.properties
-
If necessary, you can stop the JCS by pressing
^C.
Procedure 9.6. Installing a Standalone Connector Server for Windows
-
Download the OPENICF JAVA Connector Server from the OpenIDM download page under the ForgeRock Open Stack download page.
-
Unpack the zip file in the desired location, for example
C:\openicf. -
Run the command line (
Start, typecmd, andcmd) and change the working directory toopenicf\bin cd c:\openicf\bin -
Change the directory to OpenICF using the following command:
$ cd path/to/openicf
-
If needed, secure the communication between OpenIDM and JCS. The JCS uses a property called
secret keyto authenticate the connection. The default secret key value ischangeit.To change the value of the secret key enter the following, replacing
newkeywith the your own string value:/ConnectorServer.bat /setkey <newkey>
-
Review the
ConnectorServer.propertiesin the/confdirectory, and make changes as necessary. The file contains setting information, including things like ports, the allowance of one/all IP addresses, and SSL. The file provides the required information to update these settings. -
If you would like the JCS to run as a Windows service, enter the following command.
./ConnecorServer.bat /install (for uninstalling use /uninstall )
![[Note]](common/images/admon/note.png)
Note If you install JCS as a Windows service you can start/stop it by Microsoft's Service Console (
Start, typeService, andService). The JCS service is called:OpenICFConnectorServerJava.Or
If you would like to run the JCS from command line, enter the following command:
.\ConnectorServer.bat /run
-
If necessary, stop the JCS by pressing
^C.
You can view the log files in the openicf/logs directory.
This sample demonstrates using reconciliation of users stored in a MySQL database on a remote machine. The JCS runs on the same machine as the MySQL database and mediates the connection between OpenIDM and MySQL database.
Procedure 9.7. Configuring JCS
-
Download MySQL JDBC Driver.
-
Unpack the
MySQL JDBC Driverand copy themysql-connector-java-5.1.22-bin.jarto theopenicf/libdirectory. -
Go to the
/toolsdirectory. The groovy scripts in the folder run on the JCS side. Copy them frompath/to/openidm/sample/sample3/toolsfolder toopenicf/.
Procedure 9.8. Configuring OpenIDM for the MySQL Database Example
-
Start OpenIDM. You can ignore errors like
cannot connect to databaseandcannot find jdbc driver. These errors will be fixed once OpenIDM is configured and restarted. -
Go to the
provisioner.openicf.connectorinfoprovider.jsonto see information about your remote connector servers. Copy this file fromopenidm/samples/provisionerstoopenidm/conf.For Unix/Linux, enter the following in Terminal.
$ cd path/to/openidm $ cp samples/provisioners/provisioner.openicf.connectorinfoprovider.json ./conf
For Windows, enter the following on the command line.
c:\> cd path/to/openidm .\> copy .\samples\provisioners\provisioner.openicf.connectorinfoprovider.json .\conf
-
Edit the
provisioner.openicf.connectorinfoprovider.jsonto meet your needs. The following is an example.{ "connectorsLocation" : "connectors", "remoteConnectorServers" : [ { "name" : "mysql", "host" : "10.0.0.2", "port" : 8759, "useSSL" : false, "timeout" : 0, "key" : "password" } ], } -
Copy all of the files from
openidm/samples/sample3/conftoopenidm/conf.For Unix/Linux, enter the following in Terminal.
$ cp -r ./samples/sample3/conf ./conf
For Window, enter the following on the command line.
.\> copy .\samples\sample3\conf\ .\conf\
-
Edit the
provisioner.openicf-scriptedsql.jsonto read like the following.{ "name" : "hrdb", "connectorRef" : { "connectorHostRef" : "mysql", "bundleName" : "org.forgerock.openicf.connectors.db.openicf-scriptedsql -connector", "bundleVersion" : "", "connectorName" : "org.forgerock.openicf.scriptedsql.ScriptedSQLConnector" }, "producerBufferSize" : 100, "connectorPoolingSupported" : true, "poolConfigOption" : { "maxObjects" : 10, "maxIdle" : 10, "maxWait" : 150000, "minEvictableIdleTimeMillis" : 120000, "minIdle" : 1 }, "operationTimeout" : { "CREATE" : -1, "TEST" : -1, "AUTHENTICATE" : -1, "SEARCH" : -1, "VALIDATE" : -1, "GET" : -1, "UPDATE" : -1, "DELETE" : -1, "SCRIPT_ON_CONNECTOR" : -1, "SCRIPT_ON_RESOURCE" : -1, "SYNC" : -1, "SCHEMA" : -1 }, "configurationProperties" : { "host" : "10.0.0.2", "port" : "3306", "user" : "root", "password" : { "$crypto" : { "value" : { "iv" : "dsrEhCU45UakY6Uh9Jxfww==", "data" : "X1+77+0I7Yog/6ZirsFSyg==", "cipher" : "AES/CBC/PKCS5Padding", "key" : "openidm-sym-default" }, "type" : "x-simple-encryption" } }, "database" : "HRDB", "autoCommit" : true, "reloadScriptOnExecution" : false, "keyColumn" : "uid", "jdbcDriver" : "com.mysql.jdbc.Driver", "jdbcConnectionUrl" : "jdbc:mysql://10.0.0.2:3306/HRDB", "jdbcUrlTemplate" : "jdbc:mysql://%h:%p/%d", "createScriptFileName" : "/home/tester/openicf/tools/CreateScript.groovy", "testScriptFileName" : "/home/tester/openicf/tools/TestScript.groovy", "searchScriptFileName" : "/home/tester/openicf/tools/SearchScript.groovy", "deleteScriptFileName" : "/home/tester/openicf/tools/DeleteScript.groovy", "updateScriptFileName" : "/home/tester/openicf/tools/UpdateScript.groovy", "syncScriptFileName" : "/home/tester/openicf/tools/SyncScript.groovy" }, "objectTypes" : { "group" : { "$schema" : "http://json-schema.org/draft-03/schema", "id" : "__GROUP__", "type" : "object", "nativeType" : "__GROUP__", "properties" : { "name" : { "type" : "string", "required" : true, "nativeName" : "__NAME__", "nativeType" : "string" }, "gid" : { "type" : "string", "required" : true, "nativeName" : "gid", "nativeType" : "string" }, "description" : { "type" : "string", "required" : false, "nativeName" : "description", "nativeType" : "string" } } }, "organization" : { "$schema" : "http://json-schema.org/draft-03/schema", "id" : "organization", "type" : "object", "nativeType" : "organization", "properties" : { "name" : { "type" : "string", "required" : true, "nativeName" : "__NAME__", "nativeType" : "string" }, "description" : { "type" : "string", "required" : false, "nativeName" : "description", "nativeType" : "string" } } }, "account" : { "$schema" : "http://json-schema.org/draft-03/schema", "id" : "__ACCOUNT__", "type" : "object", "nativeType" : "__ACCOUNT__", "properties" : { "firstName" : { "type" : "string", "nativeName" : "firstname", "nativeType" : "string", "required" : true }, "email" : { "type" : "array", "items" : { "type" : "string", "nativeType" : "string" }, "nativeName" : "email", "nativeType" : "string" }, "__PASSWORD__" : { "type" : "string", "nativeName" : "password", "nativeType" : "JAVA_TYPE_GUARDEDSTRING", "flags" : [ "NOT_READABLE", "NOT_RETURNED_BY_DEFAULT" ] }, "uid" : { "type" : "string", "nativeName" : "__NAME__", "required" : true, "nativeType" : "string" }, "fullName" : { "type" : "string", "nativeName" : "fullname", "nativeType" : "string" }, "lastName" : { "type" : "string", "required" : true, "nativeName" : "lastname", "nativeType" : "string" }, "organization" : { "type" : "string", "required" : true, "nativeName" : "organization", "nativeType" : "string" } } } }, "operationOptions" : { } } -
Verify that the following settings are correct.
-
The value of
connectorHostRef : mysqlpoints to the propertynameofprovisioner.openicf.connectorinfoprovider.json. This indicates which connectorinfoprovider to use. -
The
bundleVersion :must be exactly the same asopenicf-scriptedsql-connector-.jar. on JCS/bundles. Unpack the.jarfile, openMETA-INF/MANIFEST.MF, and search for theBundle-Versionproperty. -
The path to groovy scripts should be
createScriptFileName : /home/tester/openicf/tools/CreateScript.groovy.For Windows, the path will follow Unix notation. For example the path could be
Program Files (x86)/openicf/tools/CreateScript.groovy, which in Windows notation would beC:\Program Files (x86)\openicf\tools\CreateScript.groovy. -
All instances of the connection setting must be properly set, for example,
jdbcConnectionUrl : jdbc:mysql://10.0.0.2:3306/HRDB.
-
-
Restart OpenIDM to verify that all of the configuration changes have occurred. There should be no error message when OpenIDM is restarted. To check run the following.
src list
This returns a list of installed modules, including the following:
[ 17] [active ] org.forgerock.openidm.provisioner.openicf
![[Note]](common/images/admon/note.png)
Note The number may differ. Make sure to note the number returned.
When you have installed more connectors, there will be more OpenICF modules. If the state of the module is active, the module is installed properly. If the state is unsatisfied, then you have not configured it correctly and you must check your configuration. You can also check the content of installed module (which could be handy if you have unsatisfied state and you want to see if the content is the same as in
*.json– to verify that the configuration you just set was picked up). To list the content of the module use the following with the number returned from the previous step:scr info 17 <your number>
![[Note]](common/images/admon/note.png)
Note You can also check the
provisioner.openicf.connectorinfoprovider -
Run reconciliation with the following command:
$ curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --request POST "http://localhost:8080/openidm/recon?_action=recon&mapping=systemHrdb_managedUser"
This will return a reconciliation id similar to the following:
{"_id":"a5346543-db9a-4f8b-ba25-af2a1b576a54"} -
Check the internal repository (OrientDB or MySQL) to make sure that the users were reconciled. For information about connecting to OrientDB, see Before You Begin in the Installation Guide. For information about using MySQL as a repository, see Installing a Repository For Production in the Installation Guide.

