Understanding the APIs for Retrieving DeviceDNA in the Sample Code

aa82test
 
 
2115293
The CA Risk Authentication Client runs on the client browser and collects the device signature and Device ID. All the client-side controls for CA Risk Authentication are provided in the CA Risk Authentication Client Javascript API. This API allows you to program the functionality of the client using JavaScript.
This section describes the CA Risk Authentication Client APIs that are used to retrieve the DeviceDNA.
ca.rm.Client()
Main JavaScript class that exposes all the published APIs of the CA Risk Authentication Client.
getVersion()
Returns a String that specifies the version of the CA Risk Authentication Client. The current supported version is 2.1.
setProperty(key,val)
Specifies the configuration values for the CA Risk Authentication Client. The following table describes the properties that you can set for this method.
 
Property Key
 
 
Description
 
baseurl
The context path of the Web application that is using DeviceDNA.
This value 
must
 be set immediately after creating an instance of ca.rm.Client JavaScript object.
No default value is supported.
didname
The cookie or local storage item name. Device ID cookie is set by using this name. The value should be a string.
flashdatastorename
The name of the Flash local store where the Flash Device ID was stored (in earlier releases).
flashPath
Not being used currently. This property is reserved for future use.
format
The format in which DeviceDNA results should be returned. The value should be one of the following a strings:
HTML
JSON
jobs
Not being used currently. This property is reserved for future use.
store
The storage area for Device ID. The value should be one of the following strings:
plugin
localstorage
cookie
default
externalIP
The IP address of the system from which the page containing the Client was served.
noFlash
The indication whether the Flash movie bundled with the Client should be used for gathering additional attributes for DeviceDNA. The value should be boolean - true or false. By default, noFlash is set to false, which implies that the Flash movie will be used.
 
 
MESC-Related Configurations
 
 
 
MESC
 stands for Machine Effective Speed Calculations. An attempt is made to estimate processor speed by executing several runs of batched arithmetic operations. In our case, it is integer addition for specified intervals of time.
 
mescmaxIterations
Specifies how many runs of the batched arithmetic operations should be executed. Default value is 2.
mesccalibrationDuration
Specifies the duration for which each batch of arithmetic operations should run. The value is specified in milliseconds. The default value is 200ms.
mescintervalDelay
Specifies the delay (in number of milliseconds) between successive runs. The value is specified in milliseconds. The default value is 50ms.
 
getProperty(key)
This API returns the currently defined value for the property represented by the 
key
. Key values are same as for setProperty(). See the table in for more information.
loadFlash(callback)
This API loads the flash movie that is part of the CA Risk Authentication Client and initializes it. The Callback function should be a JavaScript function taking a boolean flag as parameter and defined in the Web page that is calling this method.
At the end of initialization, the Callback function is invoked with parameter set to true, if the Flash movie initialization was successful. Otherwise, the Callback function is invoked with parameter set to false.
processDNA()
This is the main API of the CA Risk Authentication Client. It retrieves a number of system attributes from the end-user system and from the software installed on this system. It then computes the corresponding DeviceDNA using these values.
All the configuration settings are taken into consideration by the processDNA function while computing the DeviceDNA.
getDNA()
This API returns a string that represents the end-user system DeviceDNA, as computed by the CA Risk Authentication Client. The DeviceDNA string can either be in the HTML format or JSON format. This is controlled by the value that is specified for the format property.
getTimeTaken()
This API returns the time taken (in milliseconds) by the processDNA() call to compute the end-user system DeviceDNA.
setDID(value)
This function stores the Device ID on the end-user device. The Device ID string must be specified in the value parameter of the function.
 
getDID()
This function returns the Device ID that has been stored on the end-user device. This function also migrates older Flash cookie with the same cookie name (if present) to the Browser (HTTP) cookie store.
deleteDID()
This function deletes the Device ID that has been set on the end-user device by the CA Risk Authentication Client.