1. Prerequis :
- Liferay Google Recaptcha plugin and hook downloaded from : Link
- Google Recaptcha Api keys : Public and Private keys
2. Create Google Recaptcha Api Keys :
Go to the google recaptcha site : https://www.google.com/recaptcha/. You will see a Admin Console button at the top-right corner. It will redirect you on Google reCAPTCHA Admin page(It will ask for login to Google, if already not).
When you click on the button registre new site You will see a screen like below:
You can give value whatever you want for Label field. You need to choose reCAPTCHA v2 option. You need to add your domain to Domains field as shown in the above image. You can use multiple domains with single key/secret. After adding values to Label and Domains fields, click on Submit button.
You will redirected to a page where you will get Site key and Secret key as shown in below image:
Note : these both keys, it will require to authenticate your site with Google reCAPTCHA.
3. Deploy Google Recaptcha Liferay Hook and Ext plugin:
Disclaimer: Hence, this is an Ext plugin deployment, it is advised to first try with the Liferay server other than the Production Liferay server and test properly as per your environment configuration. We will not be responsible for any kind of damage to the Liferay server and data loss.
Now, you have to deploy attached Hook plugin first and then deploy Ext plugin. On successfully deploy ext plugin, you must have to restart your Liferay server.
Note : The Liferay server accept only one ext plugin project, if you have onther one on your server you need to add the java classes from ext-impl folder under recaptcha ext plugin to your ext project.
4. Enable reCAPTCHA:
Now, Login to Liferay portal with administrative user’s credential and go to Liferay > Control Panel > Configuration > Server Administration > CAPTCHA as shown in below:
Tick Enable reCAPTCHA. Provide Site key to reCAPTCHA Public Key and Secret key to reCAPTCHA Private Key fields, and then Save your changes