CAPTCHA YAML Configuration Reference

You can define a CAPTCHA client extension with a client-extension.yaml file.

Usage Details

This client-extnesion.yaml file defines a CAPTCHA client extension:

liferay-recaptcha-etc-spring-boot:
    captchaName: reCAPTCHA CX
    captchaResponseParameterName: g-recaptcha-response
    customElementExternalReferenceCode: LXC:liferay-recaptcha-custom-element
    name: Liferay reCAPTCHA Etc Spring Boot
    oAuth2ApplicationExternalReferenceCode: liferay-recaptcha-etc-spring-boot-oauth-application-user-agent
    resourcePath: /validation
    type: captcha

The required g-recaptcha-response property defines the response parameter with the user’s CAPTCHA response. The name of this value depends on the provider or engine issuing the CAPTCHA challenge. The parameter is necessary to receive the user’s response and validate it with the provider.

resourcePath property defines the REST controller’s location, which handles verifying user responses with a CAPTCHA engine or provider. Point to any implementation of a REST controller that’s accessible as an external application (for example, a Java Spring Boot application).

CAPTCHA client extensions require OAuth2 application profiles to secure requests triggered by object actions in Liferay. The client-extension.yaml defines an additional OAuth user agent client extension for this profile, and the oAuth2ApplicationExternalReferenceCode property references that client extension’s key value.

CAPTCHA client extensions also require custom element client extensions to handle the frontend, usually integrating with an external component. The customElementExternalReferenceCode property references that client extension’s key value.

YAML Properties

These properties are specific to CAPTCHA client extensions:

NameData TypeDescription
captchaNameString(Required) The CAPTCHA engine’s name as it appears in the Instance Settings menu.
captchaResponseParameterNameString(Required) The parameter name containing the user’s CAPTCHA response (used for validating with the provider).
customElementExternalReferenceCodeString(Required) The external reference code for a custom element client extension, needed for issuing CAPTCHA challenges to users on the frontend.
oAuth2ApplicationExternalReferenceCodeString(Required) The external reference code for an OAuth2 application profile, needed for securing requests.
resourcePathString(Required) An accessible endpoint of an external application that handles user CAPTCHA responses.