Page tree
Skip to end of metadata
Go to start of metadata
Magnolia Compatibility


5.4(tick)

Summary

Google ReCaptcha2 API module for Magnolia cms.

In this module we provide classes, annotations and form procerssors for easy and fast usage of Google ReCaptcha2 API.

Features

To use this module, include it in your module dependencies. In freemarker templates you can add recaptcha field by including [#include "/magnolia-recaptcha2/templates/macros/recaptcha2.ftl"] which contains 2 macros:

  • reCaptchaField - render recaptcha with checkbox. Accept one parameter "callback" that can be used with API callback function name.
  • reCaptchaInvisible - render invisible recaptcha. Accept one parameter "callback" that can be used with API callback function name.

Maven

Jar files can be found on Magnolia Nexus. To add in project use module dependencies:

Mven
<dependency>
    <groupId>nl.tricode.magnolia.recaptcha2</groupId>
    <artifactId>magnolia-recaptcha2</artifactId>
    <version>1.0.1</version>
</dependency>

Dependencies

core:5.5.4/*

site:1.1.1/*

Validation annotation @ReCaptcha usage

You can use: nl.tricode.magnolia.recaptcha2.validation.ReCaptcha annotation to validate recaptcha in rest calls.

Java class usage

ReCaptcha2 class provides static methods for easy recaptcha response check with api.

Form processors usage

To use it in form, we provide nl.tricode.magnolia.recaptcha2.form.processors.ReCaptcha2FormProcessor form processorwhich validates recaptcha for submitted form.

Templating functions

Templating functions provides recaptcha site keys are registered under rec2fn and can be used to provide site key to your freemarkers.

Configuration

After instaling module you need to configure API Site and API Secret key. This keys will be provided to you by Google ReCaptcha2 API after registering your site. After you get this keys, place them in Magnolia CMS -> /configuration/modules/magnolia-recaptcha2/config

  • reCaptchaSecret
  • reCaptchaSiteKey

Version History

1.0.1

  • First release on Magnolia Forge

Links


Prerequisites

License

Copyright (c) 2017 Tricode and contributors. Released under a GNUv3 license.

2 Comments

  1. Is this project still active - I noticed a 2018 commit in the github repository.

    Does it support newer versions of Magnolia? Has it been tested on newer versions?

    1. Christopher Zimmermann Tricode does not exist anymore. So maybe now this module is abandoned?

      Couple things to note about it:

      • Google is banned in China. So it certainty won't work there.
      • Some people have been reporting a bad user experience with it do to layering. Perhaps some z-index issue.

      As a workaround I would suggest trying our Form module as it provides a Honeypot field. See https://documentation.magnolia-cms.com/display/DOCS60/Form+module for more info.