This example shows how to add reCAPTCHA to your frontend and backend.
- Clone this repository.
- Open IntelliJ -> Open -> Choose the project you just cloned (The root path must contain the pom.xml!) -> The IntelliJ will load automatically.
- Get a reCAPTCHA from Google.
v3 Admin Console
->Register a new site
-> ChooseChallenge (v2)
-> Enter both your AWS public IP and "localhost" in "Domains" section -> Click "Submit" - In src/RecaptchaConstants.java, replace
YOUR_SECRET_KEY;
with your own reCAPTCHAsecret key
. - In WebContent/index.html, replace
data-sitekey="YOUR_SITE_KEY"
with your own reCAPTCHAsite key
. - In src/FormRecaptcha.java, change the mysql username and password if you don't want to use
mytestuser
. - You can run this project on Tomcat (both local machine and AWS).