reCAPTCHA

Add-On

Bot protection and spam prevention for forms using Google's reCAPTCHA service.

Status
Available
Version
v1.0.2
Supported Version
TBD
Released
2026-03-17
Licensing
Free
Usage Example

The ReCaptcha Add-On integrates Google reCAPTCHA v3 into your Oorian forms. It renders a hidden token input, auto-refreshes the token before expiration, and provides server-side verification with score-based bot detection.

Java
// Configure keys once in Application.initialize()
ReCaptchaConfig.setSiteKey("your-site-key");
ReCaptchaConfig.setSecretKey("your-secret-key");

// In createHead() — load the Google reCAPTCHA script
ReCaptchaConfig.addScript(head);

// In createBody() — add to a form
ReCaptcha captcha = new ReCaptcha("contact");
OorianForm form = new OorianForm();
form.addElement(nameInput);
form.addElement(messageInput);
form.addElement(captcha);
form.addElement(submitButton);
body.addElement(form);

// In form event handler — verify the token
String token = params.getParameterValue(ReCaptcha.INPUT_NAME);
if (captcha.verify(token, 0.5))
{
    // Score >= 0.5 — likely human, process the form
}
else
{
    // Score < 0.5 — likely bot, reject submission
}

reCAPTCHA v3 is completely invisible to users — no checkbox or challenge. Tokens are automatically refreshed every 90 seconds (configurable) to prevent expiration. Scores range from 0.0 (bot) to 1.0 (human); a threshold of 0.5 is recommended.