3 Installing and Configuring the Generic Scripting Connector

This chapter describes how to install and configure the Generic Scripting connector. It also describes the prerequisites you must meet before you can successfully install and configure the connector and the steps you must follow after installing the connector.

The procedure to install and configure the Generic Scripting connector can be divided into the following stages:

3.1 Preinstallation

Preinstallation involves downloading and copying third-party JAR file on your target system.

Before you install the connector, you must download the third-party JAR files and copy them to a local repository on the computer hosting Oracle Identity Manager. You must place the third-party JAR files in the local repository to let the connector consume it during installation and then communicate with external systems during connector operations.

If you are using BeanShell scripts for performing connector operations, then you must download and copy the BeanShell JAR file. If you are using JavaScript or Groovy scripts, then there is no need to copy any third-party JAR files as they are a part of code files for JDK and OIM, respectively. In addition, you must download and copy any third-party JAR files corresponding to the target system that you are using, if required. For example, if you plan to use BeanShell scripts to perform connector operations and are using Google Apps as your target system, then you must download and copy the BeanShell JAR file and Google Apps third-party JAR files such as google-api-client-1.18.0-rc.jar, google-oauth-client-1.18.0-rc.jar, and so on to the local repository.

You must download and copy the external code files as follows:

  1. On the computer hosting Oracle Identity Manager, create a directory named GenericScript-RELEASE_NUMBER under the following directory:

    OIM_HOME/server/ConnectorDefaultDirectory/targetsystems-lib/

    For example, if you are using release 11.1.1.5.0 of this connector, then create a directory named GenericScript-11.1.1.5.0 in the OIM_HOME/server/ConnectorDefaultDirectory/targetsystems-lib/ directory.

  2. If you plan to use BeanShell scripts for performing connector operations, then download the BeanShell JAR file (Bsh-2.1.8.jar) from the following URL:

    https://code.google.com/p/beanshell2/wiki/Downloads

  3. Copy the Bsh-2.1.8.jar file to the OIM_HOME/server/ConnectorDefaultDirectory/targetsystems-lib/GenericScript-RELEASE_NUMBER directory.

    For example, copy the JAR file to the OIM_HOME/server/ConnectorDefaultDirectory/targetsystems-lib/GenericScript-11.1.1.5.0 directory.

  4. If your target system requires any third-party JAR files to enable exchange of information from OIM, then download the necessary JAR files and copy them to the following location:

    OIM_HOME/server/ConnectorDefaultDirectory/targetsystems-lib/GenericScript-RELEASE_NUMBER

3.2 Installing the Connector

Installation information is divided across the following sections:

3.2.1 Understanding Installation

The following sections help you understand the installation procedure:

3.2.1.1 Summary of Steps to Install the Connector

Installing this connector requires you to first install the connector bundle that is included in the installation media and then install the connector package (specific to your target system) that you generated while performing the procedure described in Generating the Connector.

The following is a summary of steps to install the Generic Scripting connector

  1. Run the connector installer to install the connector bundle included in the installation media. This procedure is described later in this chapter.

  2. Run the connector installer to install the connector package (specific to your target system) that you generated while performing the procedure described in Generating the Connector. The procedure to install the connector package is described later in this guide.

  3. Configure the IT resource. See Configuring the IT Resource for the Target System for more information.

3.2.1.2 About Installing the Connector Locally and Remote

Depending on where you want to run the connector code (bundle), the connector provides the following installation options:

  • Run the connector code locally in Oracle Identity Manager.

    In this scenario, you deploy the connector in Oracle Identity Manager. Deploying the connector in Oracle Identity Manager involves performing the procedures described in Running the Connector Installer and Configuring the IT Resource for the Target System.

  • Run the connector code remotely in a Connector Server.

    In this scenario, you deploy the connector in Oracle Identity Manager, and then, deploy the connector bundle in a Connector Server. See Using an Identity Connector Server in Oracle Fusion Middleware Developing and Customizing Applications for Oracle Identity Manager for information about installing, configuring, and running the Connector Server, and then installing the connector in a Connector Server.

3.2.2 Running the Connector Installer

As discussed in one of the earlier sections, you must first install the connector bundle that is included in the installation media and then install the connector bundle that is a part of the connector package that you generated.

The procedure to install both connector bundles is the same except for the following differences:

  • Before running the connector installer to install the connector bundle from the installation media, you must copy the contents of the connector installation media to the OIM_HOME/server/ConnectorDefaultDirectory directory.

  • Before running the connector installer to install the generated connector, you must copy the unzipped connector package (generated in Generating the Connector) to the OIM_HOME/server/ConnectorDefaultDirectory directory.

In this scenario, you install the connector in Oracle Identity Manager using the Connector Installer.

Note:

In this guide, the term Connector Installer has been used to refer to the Connector Installer feature of the Oracle Identity Manager Administrative and User Console.

To run the Connector Installer:

  1. If you are installing the connector included in the installation media, then copy the contents of the connector installation media to the following directory:

    OIM_HOME/server/ConnectorDefaultDirectory

  2. If you are installing the connector from the generated connector package, then copy the unzipped connector package (generated in Generating the Connector) to the following directory:

    OIM_HOME/server/ConnectorDefaultDirectory

  3. Log in to Oracle Identity System Administration.

  4. In the left pane, under Provisioning Configuration, click Manage Connector.

  5. In the Manage Connector page, click Install.

  6. From the Connector List, select one of the following connectors:

    • If you are installing the connector included in the connector installation media, then select GenericScript Connector-RELEASE_NUMBER.

    • If you are installing the generated connector, then select the name of the connector package (generated by running the metadata generator).

    This list displays the names and release numbers of connectors whose installation files you copy into the default connector installation directory in Step 1.

    If you have copied the installation files into a different directory, then:

    1. In the Alternative Directory field, enter the full path and name of that directory.

    2. To repopulate the list of connectors in the Connector List list, click Refresh.

    3. From the Connector List list, select the relevant connector name depending on whether you are installing the connector included in the connector installation media or the generated connector.

  7. Click Load.

  8. To start the installation process, click Continue.

    The following tasks are performed in sequence:

    1. Configuration of connector libraries

    2. Import of the connector XML files (Using Deployment Manager).

    3. Compilation of Adapter Definitions

    On successful completion of a task, a check mark is displayed for the task. If a task fails, then an X mark and a message stating the reason for failure are displayed. Depending on the reason for the failure, make the required correction and then perform one of the following steps:

    • Retry the installation by clicking Retry.

    • Cancel the installation and begin again from Step 1.

    If all three tasks of the connector installation process are successful, then a message indicating successful installation is displayed.

  9. Click Exit to close the installation page.

When you run the Connector Installer, it processes the script in the GenericScript-CI.xml file located in the configuration directory. This file is listed in Table C-1.

3.2.3 Configuring the IT Resource for the Target System

The IT resource for the target system contains connection information about the target system. Oracle Identity Manager uses this information during provisioning and reconciliation.

When you run the metadata generator, the IT resource corresponding to this connector is automatically created in Oracle Identity Manager. You must specify values for the parameters of this IT resource as follows:

  1. Log in to Oracle Identity System Administration.
  2. In the left pane, under Configuration, click IT Resource.
  3. In the IT Resource Name field on the Manage IT Resource page, enter the name of the IT resource, and then click Search. The name of the IT resource is the value of the itResourceName property in the ScriptConfiguration.groovy file.
  4. Click the edit icon for the IT resource.
  5. From the list at the top of the page, select Details and Parameters.
  6. Specify values for the parameters of the IT resource. Table 3-1 describes each parameter.

    Note:

    The IT resource parameters (except for Password) described in Table 3-1 are prepopulated with values you have specified for the corresponding properties while performing the procedure described in Configuring the ScriptConfiguration.groovy File. You must specify a value for the Password IT resource parameter. For the rest of the IT resource parameters, you can verify the existing values and make changes if required.

    Table 3-1 IT Resource Parameters

    Parameter Description

    Configuration Lookup

    Name of the lookup definition that holds connector configuration entries that are used during connector operations.

    Connector Server

    Name of the connector server IT resource.

    changeLogColumn

    Name of the column where the last update-related, non-decreasing, value is stored. Can be a number or a timestamp.

    The values in this column are used during incremental reconciliation to determine the newest or most youngest record reconciled from the target system.

    Note: You must specify a value for this property if you want to perform incremental reconciliation.

    host

    Host name or IP address of the computer hosting the target system.

    Sample value: myhost

    password

    Password of the target system user account that Oracle Identity Manager uses to connect to the target system.

    port

    Port number at which the target system is listening.

    scriptType

    Name of the language in which the scripts for performing connector operations have been written.

    Sample value: BEANSHELL

    user

    User ID of the target system user account that Oracle Identity Manager uses to connect to the target system.

  7. To save the values, click Update.

3.3 Postinstallation

This section discusses the following postinstallation procedures:

3.3.1 Configuring Oracle Identity Manager

You must create a UI form and an application instance for the resource against which you want to perform reconciliation and provisioning operations. In addition, you must run entitlement and catalog synchronization jobs. These procedures are described in the following sections:

Note:

Perform the procedures described in this section only if you are using the connector in the target resource configuration mode.

3.3.1.1 Creating and Activating a Sandbox

See Managing Sandboxes in Oracle Fusion Middleware Developing and Customizing Applications for Oracle Identity Manager for instructions on creating and activating a sandbox.

3.3.1.2 Creating a New UI Form

See Managing Forms in Oracle Fusion Middleware Administering Oracle Identity Manager guide for instructions on creating a new UI form. While creating the UI form, ensure that you select the resource object corresponding to the Generic Scripting connector that you want to associate the form with. In addition, select the Generate Entitlement Forms check box.

3.3.1.3 Associating the Form with the Application Instance

By default, an application instance is automatically created after you install the connector. The name of this application instance is the one that is specified as the value of the applicationInstanceName entry in the ScriptConfiguration.groovy file. If you did not specify a value for the applicationInstanceName entry, then the application instance name will be the same as the value of the ITResourceDefName entry. You must associate this application instance with the form created in Creating a New UI Form.

See Managing Application Instances in Oracle Fusion Middleware Administering Oracle Identity Manager for instructions on modifying an application instance to associate it with a form.

After updating the application instance, you must publish it to an organization to make the application instance available for requesting and subsequent provisioning to users. See Managing Organizations Associated With Application Instances in Oracle Fusion Middleware Administering Oracle Identity Manager for instructions on publishing an application instance to an organization.

3.3.1.4 Publishing a Sandbox

Before you publish a sandbox, perform the following procedure as a best practice to validate all sandbox changes made till this stage as it is hard to revert changes once a sandbox is published:

  1. In the System Administration console, deactivate the sandbox.
  2. Log out of the System Administration console.
  3. Log in to the Self Service console using the xelsysadm user credentials and then activate the sandbox that you deactivated in Step 1.
  4. In the Catalog, ensure that the Generic Scripting application instance form appears with correct fields.
  5. Publish the sandbox. See Publishing a Sandbox in Oracle Fusion Middleware Developing and Customizing Applications for Oracle Identity Manager for instructions on publishing a sandbox.

3.3.1.5 Harvesting Entitlements and Sync Catalog

To harvest entitlements and sync catalog:

  1. Run the scheduled jobs for lookup field synchronization discussed in Scheduled Job for Lookup Field Synchronization.
  2. Run the Entitlement List scheduled job to populate Entitlement Assignment schema from child process form table. See Predefined Scheduled Tasks in Oracle Fusion Middleware Administering Oracle Identity Manager for more information about this scheduled job.
  3. Run the Catalog Synchronization Job scheduled job. See Predefined Scheduled Tasks in Oracle Fusion Middleware Administering Oracle Identity Manager for more information about this scheduled job.

3.3.2 Replacing the groovy-all.jar File

You must replace the groovy-all.jar file located on the computer hosting the connector server with the latest version that is available on the computer hosting Oracle Identity Manager.

Password provisioning operations carried out with this connector do not succeed if you fail to replace the groovy-all.jar file.

To replace the groovy-all.jar file:

  1. On the computer hosting Oracle Identity Manager, navigate to the OIM_HOME/server/apps/oim.ear/APP-INF/lib directory and copy the groovy-all.jar file.
  2. On the computer hosting the connector server, replace the groovy-all.jar located in the CONNECTOR_SERVER/lib/framework directory with the groovy-all.jar file copied from Oracle Identity Manager.

3.3.3 Localizing Field Labels in UI Forms

To localize field label that is added to the UI forms:

  1. Create a properties file (for example, GS_ja.properties) containing localized versions for the column names in your target system (to be displayed as text strings for GUI elements and messages in the Administrative and User Console).

  2. Log in to Oracle Enterprise Manager.

  3. In the left pane, expand Application Deployments and then select oracle.iam.console.identity.sysadmin.ear.

  4. In the right pane, from the Application Deployment list, select MDS Configuration.

  5. On the MDS Configuration page, click Export and save the archive to the local computer.

  6. Extract the contents of the archive, and open one of the following files in a text editor:

    • For Oracle Identity Manager 11g Release 2PS2 (11.1.2.2.0) and later: SAVED_LOCATION\xliffBundles\oracle\iam\ui\runtime\BizEditorBundle_en.xlf

    • For releases prior to Oracle Identity Manager 11g Release 2 PS2 (11.1.2.2.0): SAVED_LOCATION\xliffBundles\oracle\iam\ui\runtime\BizEditorBundle.xlf

  7. Edit the BizEditorBundle.xlf file in the following manner:

    1. Search for the following text:

      <file source-language="en"  
      original="/xliffBundles/oracle/iam/ui/runtime/BizEditorBundle.xlf"
      datatype="x-oracle-adf">
      
    2. Replace with the following text:

      <file source-language="en" target-language="LANG_CODE"
      original="/xliffBundles/oracle/iam/ui/runtime/BizEditorBundle.xlf"
      datatype="x-oracle-adf">
      

      In this text, replace LANG_CODE with the code of the language that you want to localize the form field labels. The following is a sample value for localizing the form field labels in Japanese:

      <file source-language="en" target-language="ja"
      original="/xliffBundles/oracle/iam/ui/runtime/BizEditorBundle.xlf"
      datatype="x-oracle-adf">
      
    3. Search for the application instance code. This procedure shows a sample edit for Generic Scripting application instance. The original code is:

      <trans-unit id="${adfBundle['oracle.adf.businesseditor.model.util.BaseRuntimeResourceBundle']['persdef.sessiondef.oracle.iam.ui.runtime.form.model.user.entity.userEO.UD_GENSCR_USERNAME__c_description']}">
      <source>USERNAME</source>
      <target/>
      </trans-unit>
      <trans-unit id="sessiondef.oracle.iam.ui.runtime.form.model.ACMEFORM.entity.ACMEFORMEO.UD_GENSCR_USERNAME__c_LABEL">
      <source>USERNAME</source>
      <target/>
      </trans-unit>
      
    4. Open the properties file created in Step 1 and get the value of the attribute, for example, global.udf.UD_GENSCR_USERNAME=\u4567d.

    5. Replace the original code shown in Step 7.c with the following:

      <trans-unit id="${adfBundle['oracle.adf.businesseditor.model.util.BaseRuntimeResourceBundle']['persdef.sessiondef.oracle.iam.ui.runtime.form.model.user.entity.userEO.UD_GENSCR_USERNAME__c_description']}">
      <source>USERNAME</source>
      <target>\u4567d</target>
      </trans-unit>
      <trans-unit id="sessiondef.oracle.iam.ui.runtime.form.model.ACMEFORM.entity.ACMEFORMEO.UD_GENSCR_USERNAME__c_LABEL">
      <source>USERNAME</source>
      <target>\u4567d</target>
      </trans-unit>
      
    6. Repeat Steps 7.a through 7.d for all attributes of the process form.

    7. Save the file as BizEditorBundle_LANG_CODE.xlf. In this file name, replace LANG_CODE with the code of the language to which you are localizing.

      Sample file name: BizEditorBundle_ja.xlf.

  8. Repackage the ZIP file and import it into MDS.

    See Also:

    Deploying and Undeploying Customizations in Oracle Fusion Middleware Developing and Customizing Applications for Oracle Identity Manager for more information about exporting and importing metadata files

  9. Log out of and log in to Oracle Identity Manager.

3.3.4 Clearing Content Related to Connector Resource Bundles from the Server Cache

When you deploy the connector, the resource bundles are copied from the resources directory on the installation media into the Oracle Identity Manager database.

Whenever you add a new resource bundle to the connectorResources directory or make a change in an existing resource bundle, you must clear content related to connector resource bundles from the server cache.

To clear content related to connector resource bundles from the server cache you can either restart Oracle Identity Manager or run the PurgeCache utility. The following is the procedure to clear the server cache by running the PurgeCache utility:

  1. In a command window, switch to the OIM_HOME/server/bin directory.
  2. Enter one of the following commands:
    • On Microsoft Windows: PurgeCache.bat All

    • On UNIX: PurgeCache.sh All

    When prompted, enter the user name and password of an account belonging to the SYSTEM ADMINISTRATORS group. In addition, you are prompted to enter the service URL in the following format:

    t3://OIM_HOST_NAME:OIM_PORT_NUMBER
    

    In this format:

    • Replace OIM_HOST_NAME with the host name or IP address of the Oracle Identity Manager host computer.

    • Replace OIM_PORT_NUMBER with the port on which Oracle Identity Manager is listening.

    You can use the PurgeCache utility to purge the cache for any content category.

3.3.5 Managing Logging for the Generic Scripting Connector

Oracle Identity Manager uses the Oracle Diagnostic Logging (ODL) logging service for recording all types of events pertaining to the connector.

The following topics provide detailed information about logging:

3.3.5.1 Understanding Log Levels

ODL is the principal logging service used by Oracle Identity Manager and is based on java.util.Logger. To specify the type of event for which you want logging to take place, you can set the log level to one of the following:

  • SEVERE.intValue()+100

    This level enables logging of information about fatal errors.

  • SEVERE

    This level enables logging of information about errors that might allow Oracle Identity Manager to continue running.

  • WARNING

    This level enables logging of information about potentially harmful situations.

  • INFO

    This level enables logging of messages that highlight the progress of the application.

  • CONFIG

    This level enables logging of information about fine-grained events that are useful for debugging.

  • FINE, FINER, FINEST

    These levels enable logging of information about fine-grained events, where FINEST logs information about all events.

These log levels are mapped to ODL message type and level combinations as shown in Table 3-2.

Table 3-2 Log Levels and ODL Message Type:Level Combinations

Log Level ODL Message Type:Level

SEVERE.intValue()+100

INCIDENT_ERROR:1

SEVERE

ERROR:1

WARNING

WARNING:1

INFO

NOTIFICATION:1

CONFIG

NOTIFICATION:16

FINE

TRACE:1

FINER

TRACE:16

FINEST

TRACE:32

The configuration file for ODL is logging.xml, which is located at the following path:

DOMAIN_HOME/config/fmwconfig/servers/OIM_SERVER/logging.xml

Here, DOMAIN_HOME and OIM_SERVER are the domain name and server name specified during the installation of Oracle Identity Manager.

3.3.5.2 Enabling Logging

To enable logging in Oracle WebLogic Server:

  1. Edit the logging.xml file as follows:

    1. Add the following blocks in the file:

      <log_handler name='genericscript-handler' level='[LOG_LEVEL]' class='oracle.core.ojdl.logging.ODLHandlerFactory'>
      <property name='logreader:' value='off'/>
           <property name='path' value='[FILE_NAME]'/>
           <property name='format' value='ODL-Text'/>
           <property name='useThreadName' value='true'/>
           <property name='locale' value='en'/>
           <property name='maxFileSize' value='5242880'/>
           <property name='maxLogSize' value='52428800'/>
           <property name='encoding' value='UTF-8'/>
         </log_handler>
      
      <logger name="ORG.IDENTITYCONNECTORS.GENERICSCRIPT" level="[LOG_LEVEL]" useParentHandlers="false">
           <handler name="genericscript-handler"/>
           <handler name="console-handler"/>
         </logger>
      
    2. Replace both occurrences of [LOG_LEVEL] with the ODL message type and level combination that you require. Table 3-2 lists the supported message type and level combinations.

      Similarly, replace [FILE_NAME] with the full path and name of the log file in which you want log messages to be recorded.

      The following blocks show sample values for [LOG_LEVEL] and [FILE_NAME]:

      <log_handler name='genericscript-handler' level='NOTIFICATION:1' class='oracle.core.ojdl.logging.ODLHandlerFactory'>
      <property name='logreader:' value='off'/>
           <property name='path' value='/<%OIM_DOMAIN%>/servers/oim_server1/logs/genericScriptLogs.log'/>
           <property name='format' value='ODL-Text'/>
           <property name='useThreadName' value='true'/>
           <property name='locale' value='en'/>
           <property name='maxFileSize' value='5242880'/>
           <property name='maxLogSize' value='52428800'/>
           <property name='encoding' value='UTF-8'/>
         </log_handler>
       
      <logger name="ORG.IDENTITYCONNECTORS.GENERICSCRIPT" level="NOTIFICATION:1" useParentHandlers="false">
           <handler name="genericscript-handler"/>
           <handler name="console-handler"/>
         </logger>
      

    With these sample values, when you use Oracle Identity Manager, all messages generated for this connector that are of a log level equal to or higher than the NOTIFICATION:1 level are recorded in the specified file.

  2. Save and close the file.

  3. Set the following environment variable to redirect the server logs to a file:

    • For Microsoft Windows:

      set WLS_REDIRECT_LOG=FILENAME
    • For UNIX:

      export WLS_REDIRECT_LOG=FILENAME

    Replace FILENAME with the location and name of the file to which you want to redirect the output.

  4. Restart the application server.

3.4 Upgrading the Connector

Upgrading the connector is not applicable as this is the first release for this connector.