Iron Speed Technical Forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
azwiefel

Registered:
Posts: 43
Reply with quote  #1 
reCAPTCHA v2 is now causing issues with password recovery in ISD developed projects, not knowing how ISD originally integrated the reCAPTCHA component it's been a pain to update.

Has anyone updated to the V2 component and willing to share the process?
thanks 

 

 


__________________
Quote of the Week:
We must not allow the clock and the calendar to blind us to the fact that each moment of life is a miracle and a mystery.
– H.G. Wells (1866-1946)
azwiefel

Registered:
Posts: 43
Reply with quote  #2 
Bump?
__________________
Quote of the Week:
We must not allow the clock and the calendar to blind us to the fact that each moment of life is a miracle and a mystery.
– H.G. Wells (1866-1946)
sdms

Registered:
Posts: 139
Reply with quote  #3 
I am also looking for a solution other than removing recaptcha from the page.
azwiefel

Registered:
Posts: 43
Reply with quote  #4 
Bumpity, bump, bump...
__________________
Quote of the Week:
We must not allow the clock and the calendar to blind us to the fact that each moment of life is a miracle and a mystery.
– H.G. Wells (1866-1946)
alant

Registered:
Posts: 52
Reply with quote  #5 
I followed this link to implement:
http://codewithjitin.blogspot.co.nz/2017/08/how-to-use-google-invisible-recaptcha_28.html

I have the following in HTML in a field on a web page (ForgotUser.aspx)

Code:

<gen:label id="FillRecaptchaLabel" /> 
<br /><br />
<div class="g-recaptcha" data-sitekey="**MY SITE KEY ***"></div>


And then in the code-behind (ForgotUser.Aspx.cs)

Code:

        public bool ValidateCaptcha(string response)
        {
            // http://codewithjitin.blogspot.co.nz/2017/08/how-to-use-google-invisible-recaptcha_28.html
            string secret = "**** PUT YOUR VALUE HERE *****";
            var client = new WebClient();
            var reply = client.DownloadString(string.Format("https://www.google.com/recaptcha/api/siteverify?secret={0}&response={1}", secret, response));
            JavaScriptSerializer jsSerializer = new JavaScriptSerializer();
            var result = jsSerializer.DeserializeObject(reply);
            Dictionary<string, object> obj2 = new Dictionary<string, object>();
            obj2 = (Dictionary<string, object>)(result);
            var captchaResponse = obj2["success"].ToString();
            bool ret_isValid = Convert.ToBoolean(captchaResponse);
            return ret_isValid;
        }


Then in a code block on a button I have this code fragment

Code:

  bool isCaptchaValid = ValidateCaptcha(Request["g-recaptcha-response"]);
  try {
      if(!isCaptchaValid)
      {
          throw new Exception("Invalid Captcha Response");
      }
      if (!this.Page.IsValid)
      {
          throw new Exception("Invalid Captcha Page");
      }
      // your code which depends on valid captcha
      
  }
  catch (Exception ex) {
    // usual stuff here
  }


And lastly, on my master page, in the Page Directives I added the following:
Code:

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


It's pretty straight forward stuff. Just read the link at the top of the page.
And use my code as a sample of how to put it into an Ironspeed Page.
It took me 1 hour to research google, and 1 hour to implement.

I hope you've at least spent that long looking yourself before just asking on the forum


__________________
Alan Telford
azwiefel

Registered:
Posts: 43
Reply with quote  #6 
Thank you Alant, I'll research a little more but this looks like a viable solution. I'll upload the final set of code snippets when completed.
__________________
Quote of the Week:
We must not allow the clock and the calendar to blind us to the fact that each moment of life is a miracle and a mystery.
– H.G. Wells (1866-1946)
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Download Iron Speed Designer

Terms of Service Privacy Statement