Standard Setup

 

Overview

There are two steps required to fully implement the Arkose Labs Detection and Prevention Platform (Arkose Labs Platform):

  1. Client-side implementation that allows the Arkose Labs Platform to collect data necessary to classify the traffic from the client, display an Enforcement Challenge (EC) if necessary, and provide a one-time use token.

  2. Server-side implementation that takes the token provided by the client-side and verifies it with the Arkose Labs verify API. The result is a response that contains information about the session, either in a simple format or as a JSON.

This guide documents the steps required to implement the client-side processing. There are separate instructions for iOS and Android.

API Sequence

API Request Authentication

Arkose Labs authenticates your API requests using a private/public key pair that can be retrieved from the Site Settings page of the Arkose Labs Client Dashboard. If you do not have access to the dashboard or do not have your private and public keys, contact your Sales Rep or Sales Engineer.

The private key is needed to authenticate when using the verify API. This private key must not be published on a client facing website, and must only be used on your server-side implementation on the Arkose Labs verify API.

Response Object

When an enforcement is completed, the configured onCompleted function is invoked with a response object.

1 2 3 onCompleted: function(response) { // sendToBackendServer(response.token); }

Method

Type

Description

Method

Type

Description

response.token

String

The token you will need to send to your back-end server for verification.

Server Side Set Up

When you have successfully set up your client-side set up you must set up your server by following the server-side instructions.

AWS China Solution

If you are using the AWS China solution you will need to add some more steps to this process. See https://support.arkoselabs.com/hc/en-us/articles/4401849614227-Get-Started-with-Arkose-Labs-in-China for more details.

 

Example Implementations

These code examples show possible implementations of the Arkose Labs Platform.

Session Invocation + Modal Overlay

The example below shows the following:

  1. The enforcement challenge loaded as a semi-opaque modal screen.

  2. The session is loaded and the appropriate challenge is displayed, depending on the key settings.

    1. If the key is set to transparent mode, and the user’s credentials are validated, the modal box will disappear automatically after an imperceptible pause.

In this example, form elements are locked out until the Arkose Labs session is ready. To make this sample complete, the response.token is output to an alert box. In production the response.token is sent back to your server for further inspection.

Full Modal Overlay

The example below shows the following:

  1. The enforcement challenge loaded as a semi-opaque modal screen.

  2. The session is loaded and the appropriate challenge is displayed, depending on the key settings.

    1. If the key is set to passive mode, and the user’s credentials are validated, the modal box will disappear automatically after an imperceptible pause.

In this example, Configuration Object parameters are manually set (eg. Language), and additional parameters can be passed if necessary.

To make this sample complete, the response.token is output to an alert box. In production, the response.token is sent back to your server for further inspection.

Inline Mode

In the example below, the EC is loaded and displayed inline on the page inside the element specified by selector in setConfig

To make this sample complete, the response.token is output to an alert box. In production, the response.token is sent back to your server for further inspection.