Defining a Client Plug-In
To define a client plug-in, perform the following steps.
-
Create a file that contains the JavaScript and HTML code to be integrated into the HTML page generated by the ActivID CMS Portal. The JavaScript code contains the function to call, and the HTML code contains the tags for third-party components.
-
Add entries to the generic_plugin.properties file that describe for which hook (USER_INFO, DEVICE_PRODUCE, etc.) and with which parameters the plug-in is to be called by the ActivID CMS.
The generic_plugin.properties file is located on the server in the %PROGRAMDATA%\HID Global\Credential Management System\Shared Files\ directory and contains detailed information on the hooks available for each ActivID CMS function (device issuance, device replacement, device unlock, etc.)..
For each plug-in:
-
Specify the name of the control to be called to invoke the plug-in. plug_in_name.control is the plug-in name used by ActivID CMS to identify the name of JavaScript function to call.
For example, if the control parameter is ClientPluginSample1, then the function defined in the HTML is ClientPluginSample1_invokeAsync.
Plug-ins are invoked with a callback function in the order in which their plug_in_name.control entries appear in the properties file. ActivID CMS waits for all the plugins to return data via their callback and only proceeds when all the callbacks are called with a successful value; otherwise, the hook is aborted and the corresponding ActivID CMS function is terminated.
-
Define the name of each attribute to be passed to the plug-in, in the form: plug_in_name.input. This lists the attribute names that are to be passed to the client plug-in by the ActivID CMS invokeAsync function. For example:
CopyGenericPluginSample1.input = cn:str, givenName:str
Supported types: str only for string, bin for binaryImportant: If you have configured ActivID CMS to work with more than one type of directory, you may need to specify the directory type by adding a suffix with the directory short name (for example, <plugin name>.input.msft-ad). For details about the directory short names, see Configuring the Generic Plugin.
-
Specify the attributes to be returned by the plug-in to the callback function, in the form: plug_in_name.output. This lists the attribute names that have values produced by the plug-in. ActivID CMS transports the resulting values to the server and sets the corresponding attributes.
Important: If you have configured ActivID CMS to work with more than one type of directory, you may need to specify the directory type by adding a suffix with the directory short name (for example, <plugin name>.output.msft-ad). For details about the directory short names, see Configuring the Generic Plugin. -
Specify the name of the HTML page that defines the JavaScript invokeAsync function: plug_in_name.page is the name of the HTML file.
-
Add the plug-in name to the client plug-in list for the logical step that corresponds to the screen where the plug-in is needed.
For example, to declare the ClientPluginSample1 client plug-in (in the first screen of the device issuance process), the entry in the generic_plugin.properties file would look something like the following example:
CopyUSER_INFO.plugin.client = ClientPluginSample1
Note: It is recommended that you do not use JSP files to define the JavaScript invokeAsync function as plug-ins. This file type is pre-compiled, and it is not easy to insert them dynamically into the ActivID CMS framework. -
-
Store HTML pages and third-party packages in the following directory: cms_install_dir\Credential Management System\cms_portal\data
Where cms_install_dir represents the directory where ActivID CMS is installed.