how-to-create-a-google-recaptcha-component-in-cq5

Pritam asked 2 years ago

I want to implement a Google Recaptcha component in AEM. I am quite new to AEM, and it will be very helpful if anyone can kindly guide me with this issue.

5 Answers
Var answered 2 years ago

All you need is to do these steps
1) Get the Google g-recaptcha key with your domain name. (i.e. your website domain name which might differ for DEV, Staging, prod, Etc environments)
2) in your JSP/HTML code add the data-sitekey (example as shown below)
3) if your Captcha verification is going to be done in OSGI layer you have to write it in the particular java class for receiving the input of the captcha and verification, based on the result you have to continue for the remaining code logic (Same applies for the Java Script verification process if any validation of the captcha is done at Script level.)
4) Make sure to give the flexibility to author the data-sitekey in the component level so that moving across environments will be easier to update by authors.
Example HTML snippet for sitekey

<script src=”https://www.google.com/recaptcha/api.js”></script&gt;
</head>
<body>
<form action=”authenticationServlet” method=”post”>
Username: <input type=”text” name=”username”> <br> Password:
<input type=”password” name=”userpassword”> <br>
<div class=”g-recaptcha”
data-sitekey=”6LdMAgMTAAAAAGYY5PEQeW7b3L3tqACmUcU6alQf”></div>
<br> <input type=”submit” value=”Login”>
</form>
</body>
</html>

Note:-
That all domain name keys will work with localhost domain for testing and development
For more information
https://developers.google.com/recaptcha/docs/faq#does-recaptcha-support-users-that-dont-have-javascript-enabled
http://www.journaldev.com/7133/how-to-integrate-google-recaptcha-in-java-web-application

Raj answered 1 year ago

You can refer this article

Integrate Google reCAPTCHA with AEM

click answered 4 weeks ago

Thanks for the nice post for me have to look the remember passwords in egde system easily and getting the function to secure the all data and web site.

suzain lian answered 3 weeks ago

its usually as a nice writing for me need to explain it in a better way for sure will buy essay from We Write Essay students get their essay done fast as they need help

Antonia Cummins answered 3 weeks ago

This is why many places have laws about Professional Powerpoint Presentation Writers not being able to act as interpreters and translators for their parents.

Your Answer