CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) is a program commonly used in online transactions to distinguish between humans and automated programs or bots. It poses a challenge and evaluates user response to determine if it’s a human or a bot interacting with the site. It prevents the user to proceed if the test fails and helps make online transactions secure by keeping bots from posting spam or malicious purposes.
AEM Forms supports CAPTCHA in adaptive forms. You can use reCAPTCHA service by Google to implement CAPTCHA.
AEM Forms support only reCaptcha v2. Any other version is not supported.
CAPTCHA in adaptive forms is not supported in offline mode on AEM Forms app.
Form authors can use the reCAPTCHA service by Google to implement CAPTCHA in adaptive forms. It offers advanced CAPTCHA capabilities to protect your site. For more information on how reCAPTCHA works, see Google reCAPTCHA.
To implement the reCAPTCHA service in AEM Forms:
Obtain reCAPTCHA API key pair from Google. It includes a site key and secret.
Create configuration container for cloud services.
Go to Tools > General > Configuration Browser.
Do the following to enable the global folder for cloud configurations or skip this step to create and configure another folder for cloud service configurations.
In the Configuration Browser, tap Create.
In the Create Configuration dialog, specify a title for the folder and enable Cloud Configurations.
Tap Create to create the folder enabled for cloud service configurations.
Configure the cloud service for reCAPTCHA.
Once the reCAPTCHA service is configured, it is available for use in adaptive forms. For more information, see Using CAPTCHA in adaptive forms.
To use CAPTCHA in adaptive forms:
Open an adaptive form in edit mode.
Ensure that the configuration container selected when creating the adaptive form contains the reCAPTCHA cloud service. You can also edit adaptive form properties to change the configuration container associated with the form.
From the component browser, drag-drop the Captcha component onto the adaptive form.
Using more than one Captcha component in an adaptive form is not supported. Also, it is not recommended to use CAPTCHA in a panel marked for lazy loading or in a fragment.
Captcha is time-sensitive and expires in about a minute. Therefore, it is recommended to place the Captcha component just before the Submit button in the adaptive form.
Select the Captcha component you added and tap to edit its properties.
Specify a title for the CAPTCHA widget. The default value is Captcha. Select Hide title if you do not want title to appear.
From the Captcha service drop-down, select reCaptcha to enable reCAPTCHA service if you configured it as described in ReCAPTCHA service by Google. Select a configuration from the Settings drop-down. Also, select the size as Normal or Compact for the reCAPTCHA widget.
Do not select Default from the Captcha service drop-down as the default AEM CAPTCHA service is deprecated.
Save the properties.
The reCAPTCHA service is enabled on the adaptive form. You can preview the form and see the CAPTCHA working.