Steps to integrate captcha

The image below explains the integration procedures. Before starting the next step, please check if you have successfully integrated the current steps.

productflow

Step 1. Get your captcha ID and KEY

If you don’t have a GeeTest account, please firstly get your GeeTest account.

If you already have a GeeTest account, please sign in and enter GeeTest captcha dashboard. Click +New captcha to add a new captcha. Then, you will get a set of unique captcha ID and KEY . You can modify the security setting in the dashboard.

The following is an example of captcha ID and KEY.

ID(07df3141a35**********19a473d7c50), 
KEY(543b19036ef********8e07d121b81e9)

Step 2. Integrate server SDK

Server SDK provides two APIs for client, i.e. API1 and API2. Please check the Server SDK integration for the detailed explaination and examples.

What to check:

  • Whether API1 and API2 could be accessed successfully. If you call API2, it will return fail. Please replace the URLs with the URLs that you assign to API1 and API2 (see the example below). If error reports when you call the API2 and read the session, please comment out the session.
API1:  
request: curl -c /tmp/cookie 'http://www.geetest.com/demo/gt/register-slide'
response:
{
"success": 1,
"challenge": "916e3a63fd4029a600fe5be03d6aa9aa",
"gt": "e52c06c937981b90b275d0aff1d40076",
"new_captcha": true
}
API2
request: curl -b /tmp/cookie -d 'geetest_challenge=1a76d9da01e21b0178824dbed1425ecaiy&geetest_validate=727f1edd0455aeff265f9903d7ac097a&geetest_seccode=727f1edd0455aeff265f9903d7ac097a|jordan' 'http://www.geetest.com/demo/gt/validate-slide'
response:
{
"status":"fail",
"info":"登录失败"
}

Step 3. Integrate client SDK

The client SDK support Web, iOS and Android. You can find the detailed explanation and example in Client Integration.
What to check:

  • Whether API1 could be successfully accessed. If the API1 could return the challenge , captcha was successfully initialized.
  • Whether the captcha challenge could pop out.
  • Whether the captcha could be interacted with. After you have passed the verification, it will prompt verification succeeded.
  • If you call the API2, it will return 3 variables geetest_challenge, geetest_validate and geetest_seccode.
  • After you call the API2, you can find in the browser console or through package capture that the request has been sent successfully.

Step 4. Check the API2

This step aims to check if the API2 can correctly verify whether the captcha has been passed.

What to check:

  • The Server successfully receives API2 request from Client and get three variables, including geetest_challenge, geetest_validate and geetest_seccode.

  • After Server calls the method in the SDK, it returns data to Client, which can correctly indicate whether the verification is successful.

  • The Client successfully receives the returned result of API2 and executes the corresponding process according to the returned result.

Step 5. Fallback mode simulation

Failback mode is an emergency solution for downtime. GeeTest’s captcha is designed to provide a stable and secure service. In some unavoidable case or force majeure, Failback mode could be used to ensure normal operation in downtime.

The available status of GeeTest cloud server (gt_server_status) is stored in the session of API1 and can be returned to client with success. The client could use success to decide whether perform the Failback mode. The API2 can get gt_server_status from session and decide to get the secondary verification result from local or GeeTest cloud server.

How to simulate the Failback mode?

Please fill in an incorrect string (e.g. 123456789) for the captcha ID. Then, it will enter the Failback mode.

What to check:

  • Check if the verification process is correct in Fallback mode.