Recaptcha not working in China

5,878 views
Skip to first unread message

vivek soundrapandi

unread,
Nov 1, 2018, 2:49:30 PM11/1/18
to reCAPTCHA
I am using Google recaptcha V2 in my website. I chose to go with the option of explicitly rendering the option widget[https://developers.google.com/recaptcha/docs/display#explicit_render].

However, I found that the google.com domain is blocked by China firewall hence the captcha was not getting redered. I Came across this link in FAQ, where it was asked to just use recaptcha.net instead of  google.com

I loaded the script with recaptcha.net.

    <script src="https://www.recaptcha.net/recaptcha/api.js?onload=onloadCallback&render=explicit"
       
async defer>
   
</script>
   


Though I changed the domain as instructed , I am still seeing a request being sent to google.com for verifying the captcha. This is because of the script loading another script called recaptcha__en.js[https://www.gstatic.com/recaptcha/api2/v1540189908068/recaptcha__en.js]. This script has the API url as google.com/recaptcha/api/userverify, and hence the verify request gets blocked by the firewall. I tried to set the recaptcha API url explicitly window['__recaptcha_api'] = "https://www.recaptcha.net/recaptcha/"; but I endedup my browser blocking the worker script, with the below error message:
Failed to construct 'Worker': Script at

reCAPTCHA support

unread,
Nov 1, 2018, 5:17:50 PM11/1/18
to reCAPTCHA
The only thing that you need to do is load the script from https://www.recaptcha.net/recaptcha/api.js. Our system will pick the appropriate url to use. If you are testing it outside of china, it will use www.google.com. There is no way to force it to use www.recaptcha.net in this case. Explicitly trying to override "window['__recaptcha_api']"is unsupported and could break at anytime.

Best Regards
-reCAPTCHA Support Team.

vivek soundrapandi

unread,
Nov 2, 2018, 12:08:50 PM11/2/18
to reCAPTCHA
On a followup, the below details could be better rephrased and added to that FAQ question to help others

vivek soundrapandi

unread,
Nov 2, 2018, 12:08:50 PM11/2/18
to reCAPTCHA
Thanks a lot, yes it did work when tested from China. Kudos Team.


On Friday, November 2, 2018 at 2:47:50 AM UTC+5:30, reCAPTCHA support wrote:

Bob McClain

unread,
Sep 10, 2019, 5:14:50 PM9/10/19
to reCAPTCHA
Hi we are running into the same issue where the captcha is not working in china. Just want to confirm, is this solution still working because we are trying to decide what our options are moving forward. We started looking at other captcha code solutions that say they work in china but if we can make a simple change as suggested here and it solves our problem we will move that direction. Please let me know if this solution stills works.

thank you 
Reply all
Reply to author
Forward
0 new messages