🖥️JavaScript Programming
Last updated
Last updated
These instructions assume a development methodology leveraging traditional web programming (html and javascript, etc.); the AuthenticAction™ SDK is added to your web project through declaration of a script library in pages using the SDK.
To start using AuthenticAction™ in your page(s), first declare the script in your html, as follows
you'll need to install it in your project. You can do this by including a script tag that you get in your integration setup.
Note: the exact name and version of the script library in your project may slightly differ, and is listed here as an example. As part of your organizations integration startup package, you will be supplied with various SDK connectivity information, including an organization key and access to the applicable version of the .js library for your project.
Now that you have the SDK declared in your page(s) within your project, you can start using it by adding some simple code within the page.
The first thing you'll need to do is initiate the Ironvest
Class with your selected option configuration. During declaration of a new IronVest instance, you will pass in the organizationKey, csid and uid.
You must have the cid
(ClientId) provided by IronVest to be used with the SDK.
Note: As part of your organizations integration startup package, you will be supplied with various SDK connectivity information, including an client ID and an api key.
Please note that you have to create your own application Session ID to initiate the IronVest SDK's session. An Ironvest
instance is usually associated with a user's login session and is used to correlate the actions performed to a particular user. It's possible to create a new scope by setting a new Session ID by calling setCsid() or by creating a new Ironvest
instance.
A description of the CSID can be found under the Components and Considerations section.
Setting the UID provides context to the unique session, and associates the session activity with a specific user.
A description of the UID can be found under the Components and Considerations section.
For more information about the options, see the Components and Considerations section. For more information about what data is being collected, see the The AuthenticAction Data section.
To help illustrate how to use Ironvest
class, the following common use case is illustrated:
Updating a session
Starting biometric enrollment
Starting a biometric session to protection of a form
Finishing a biometric session
Update client session ID:
This function can be used to the ID on a class that was initiated without CSID (because it was unknown at the time of initialization) or to start a new session for the same or a different user. Note that this function should be called any time the csid
is updated
Update User ID:
This function can be used to the ID on a class that was initiated without UID (because it was unknown at the time of initialization) or to start a new session for the same or a different user. Note that this function should be called any time the uid
is updated
Note that this method should be used only if active enrollment is configured
Start biometric enrollment: To enroll a new user for biometrics. You need to specify the element id of the DOM element where the selfie image should be presented during the enrollment phase.
If passive enrollment is configured, this method will trigger passive enrollemnt for users who are not yet enrolled.
Starts biometric at protected form.
On the protected form if you want to mount the camera on, first need to call startBiometricSession
and then to stop the video, you need to call stopBiometric
.
It's required to specify <mount-camera-element-id>
parameter with the ID of the element where the selfie images should be placed in the background.
Stop biometrics at protected form:
Trigger the stopBiometric
function once the protected action is complete and you want to close the biometric capture and display.
Represents an AutenticAction.
new Ironvest(options)
Initiate the AuthenticAction.
Constructor parameters:
Parameters example:
Set CSID and UID. Can be used to start a new session, i.e. create a new scope for the data capture.
Parameters:
Initiates biometric session. Other AutheticAction factors are collected throughout the entire session lifetime, however biometric data requires explicit initialization that is triggered by calling this method.
Parameters:
Finishes biometric session. Closes the camera and stops biometric capture.
Parameters:
None.
Supported from version 2024-06-1 and above
Request permission for a specified resource.
Parameters:
Returns:
Throws:
Supported from version 2024-06-1 and above
Check permission status of a specified resource.
Parameters:
None.
Returns:
The SDK generates logs throughout its execution. These logs are useful to pinpointing different usage and integration issues and can be found in the browser's debug console. Normally it will only output warning and error messages. If you wish to see verbose logs you should specify debug: true
option in the Ironvest class initialization.
Reviewing the Network section was also proved to be useful when troubleshooting issues.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Type | Description |
---|---|
Type | Description |
---|---|
csid
string
Customer Session ID. This parameter is required. If the value is identical to the one previously set, the data will continue being collected for the same context
uid
string
<Optional> User identifier must be unique and consistent. If skipped a UID that was previously set will remain in effect. If UID was not previously set, the new value will be applied for the entire session context.
elementId
string
ID of the DOM element where camera feed should be mounted for presenting the selfie image to the user. If skipped, the camera feed will be captured but the selfie image will not be presented on the screen.
string
The name of the permission requested. Currently only 'camera' is supported
Promise<string>
A promise that resolves to the result of the permission request:
'granted' if the permission has been granted
'denied' if the permission has been denied.
Error
Throws an error if the permission request method is not implemented for the specified permissionName or another error occurred
Promise<Object>
A promise that resolves to an object containing the status of the used permissions. For each permission name (e.g. 'camera'):
'granted' if the permission has been granted
'denied' if the permission has been denied
'prompt' if the user has not yet been asked for the permission
'unknown' if an error occurred while checking the permission status