Adding reCaptcha to the login page

You must go to the Google reCaptcha website and register your domain and get a data site-key

https://www.google.com/recaptcha/

* Need to first edit this page:  c:\Windows\web\RDWeb\Pages\en-US\login.aspx

This page needs a few customizations

Search for <HTMLMainContent> and add the following lines after it

<HTMLMainContent>

  <script src="https://www.google.com/recaptcha/api.js"></script>

 

 

  <script type="text/javascript">

   function callValidation(){

     if(grecaptcha.getResponse().length == 0){

                alert('Please click the reCAPTCHA checkbox');

                return false;

            }

            return onLoginFormSubmit();

            return true;

        }

</script>

Search for this piece of code. 

<form id="FrmLogin" name="FrmLogin" action="login.aspx<%=SecurityElement.Escape(strReturnUrl)%>" method="post" onsubmit="return onLoginFormSubmit();">    

Change onLoginFormSubmit   to  callValidation

<form id="FrmLogin" name="FrmLogin" action="login.aspx<%=SecurityElement.Escape(strReturnUrl)%>" method="post" onsubmit="return callValidation();">

Search for this line of code. Easiest to do a search for this phrase: btnSignIn

<td align="right"><label><input type="submit" class="formButton" id="btnSignIn" value="<%=L_SignInLabel_Text%> " /></label>

Immediately after this line, add this line

(Enter your site key that you got from the Google reCaptcha website)

<div class="g-recaptcha" data-sitekey="ENTER YOUR GOOGLE SiteID here"></div>

Save your file. Now you must do the next step

To ensure all the browsers (especially IE and EDGE) work, you must change the default compatability mode from IE 9 standards to IE 11. 

** If you do not, reCaptcha will hang and not work in IE and EDGE

* Edit this file: c:\windows\web\RDWeb\Pages\Site.xsl

Search for this line. Easiest to search for phrase IE=9

Change IE=9 to IE=11

<meta http-equiv="X-UA-Compatible" content="IE=9"/>

<meta http-equiv="X-UA-Compatible" content="IE=11"/>

Save your file. This should now work for you in all browsers