reCAPTCHA Spring Integration
<dependency>
<groupId>com.github.dtrunk90</groupId>
<artifactId>recaptcha-spring-integration</artifactId>
<version>2.0.1</version>
</dependency>
Usage
Simply extend your @ModelAttribute
(important!) and @Valid
annotated Form object from AbstractRecaptchaForm. Alternatively, if the default doesn't fit your needs you can add your own @Recaptcha
annotated field/method. Per default authenticated users will be skipped. So you don't need to display the widget if the user is authenticated. Add the mandatory properties to your project (the URL is optional):
Property | Default value |
---|---|
recaptcha.secret-key | |
recaptcha.site-key | |
recaptcha.verify-url | https://www.google.com/recaptcha/api/siteverify |
Do the client side implementation as described here for reCAPTCHA v2 or here for Invisible reCAPTCHA.
In case you don't use Spring Boots autoconfiguration feature you have to configure it yourself. Take a look into RecaptchaAutoConfiguration for more information.