--- title: Drupal description: Install the CaptchaLa Drupal module to protect login, registration, password reset, contact, comment and any other form through the CAPTCHA module. --- # Drupal Official CaptchaLa module for Drupal. It adds CaptchaLa as a challenge type of the contributed [CAPTCHA](https://www.drupal.org/project/captcha) module, so you can put it on the login, registration, password reset, contact and comment forms, or on any other form, without writing code. Every widget is backed by a **server-issued, single-use token**, and each submission is checked on your server before Drupal processes the form. ## What it covers CaptchaLa protects every form you assign it to in the CAPTCHA module. The action is picked from the form ID: | Form ID | Action | | --- | --- | | `user_login_form`, `user_login`, `user_login_block` | `login` | | `user_register_form` | `register` | | `user_pass` | `lost_password` | | `user_pass_reset*` | `reset_password` | | `comment_*` | `comment` | | `contact_*` (including `contact_message_form`) | `contact_form` | | Any other form | `generic_form` | A token solved for one kind of form is refused on another. When a check fails, the submission stops with a normal Drupal form error and the visitor can try again. ## Requirements - Drupal 9, 10 or 11 - PHP 8.1+ - The [CAPTCHA](https://www.drupal.org/project/captcha) module 2.x - A CaptchaLa account — get your **App Key** + **App Secret** at [`dash.captcha.la`](https://dash.captcha.la) ## Install 1. Copy the [GitHub repository](https://github.com/Captcha-La/captchala-drupal) to `modules/contrib/captchala`. 2. In the site root, install the PHP SDK and the CAPTCHA module: ```bash composer require captchala/captchala-php drupal/captcha ``` 3. Enable both modules: ```bash drush en captchala captcha ``` ## Configure 1. Go to **Administration → Configuration → Web services → CaptchaLa** (`/admin/config/services/captchala`). 2. Paste your **App Key** and **App Secret**, then click **Test connection** to check the credentials end-to-end. 3. Choose a **Product** (widget mode) and **Language**, and click **Save configuration**. 4. Go to **Administration → Configuration → People → CAPTCHA module settings** (`/admin/config/people/captcha`) and pick **CaptchaLa** as the challenge type for each form you want to protect. Both pages need the **Administer CAPTCHA settings** permission. | Setting | Default | Description | | --- | --- | --- | | App Key | — | Public key from the CaptchaLa dashboard. Required. | | App Secret | — | Server secret, used to issue and validate tokens. Required; never sent to the browser. Leave the field empty to keep the saved secret. | | Product | `bind` | `bind` (the check runs when the visitor presses the form's submit button), `popup`, `float` or `embed` (a verification bar inside the form). | | Language | `auto` | A BCP-47 tag such as `ja` or `pt-BR`, or `auto` to follow the language of the Drupal page. | | Skip CAPTCHA for logged-in users | on | Authenticated users see no challenge on protected forms. | | Log validation failures | off | Writes failed checks to the Drupal log. Useful while setting up. | ## Screenshots ![CaptchaLa settings page in Drupal with credentials, a successful connection test, widget and behaviour options](/images/plugins/drupal/settings.webp) ![Drupal login form with the CaptchaLa bar showing Verified](/images/plugins/drupal/login-form.webp) ![Drupal contact form with the CaptchaLa bar showing Verified above Send message](/images/plugins/drupal/contact-form.webp) ## Notes - **Fallback.** Until the App Key and App Secret are saved, or if CaptchaLa cannot be reached when the form is built, the module shows the CAPTCHA module's Math challenge instead, so the form is never left unprotected. Administrators see a reminder to enter the credentials. - **Page cache.** Each protected form carries its own token, so Drupal does not cache those pages for anonymous visitors. ## Troubleshooting - **A Math question appears instead of CaptchaLa.** The credentials are missing or the check could not be started. Run **Test connection** on the settings page, and turn on **Log validation failures** to see details in the Drupal log. - **Every submission is refused.** Make sure the App Key and App Secret belong to the same app, and that your site's domain is allowed for that app in the dashboard. - **Trying it out.** The public [test keys](/testing) let you check the full flow without an account. ## Links - Source and issues: [github.com/Captcha-La/captchala-drupal](https://github.com/Captcha-La/captchala-drupal) - Support: [supply@captcha.la](mailto:supply@captcha.la)