reCAPTCHA server side validation with POST has stopped working

1,863 views
Skip to first unread message

Steve

unread,
Jun 30, 2016, 8:38:08 AM6/30/16
to reCAPTCHA
I'm using POST method to validate captcha on server side because of API documentation. It worked perfectly, but now I have some error-codes:
{
  "success": false,
  "error-codes": [
    "missing-input-response",
    "missing-input-secret"
  ]
}
So what is the problem, maybe something has changed on google side?

Steve

unread,
Jul 4, 2016, 3:18:21 AM7/4/16
to reCAPTCHA
The problem is when you use json body like this:
{
  "response" : "asdasd",
  "secret" : "asdasdsad"

UoS Web Team

unread,
Jul 4, 2016, 5:06:09 AM7/4/16
to reCAPTCHA
Hello,

We are currently experiencing the same issues and this has only started happening recently.  No code has been modified and the CAPTCHAs were working fine previously.  The errors we are receiving are:-

"invalid-json"; and
"Failed to open stream. Connection timed out." [https://www.google.com/recaptcha/api/siteverify]

Does anyone know why this has started happening and how to fix it?

Thank you.

UoS Web Team

unread,
Jul 4, 2016, 6:20:37 AM7/4/16
to reCAPTCHA
Hello again,

I have done some investigation and after conducting some tests I have discovered that https://www.google.com/recaptcha/api/siteverify will fail to connect when you connect using IPv6.  Forcing the connection to use IPv4 then connects successfully.  When not specifying either IPv6 or IPv4 it seems that IPv6 takes precedence, but when it fails it then tries IPv4; however this retry doesn't appear to get cascaded to the calling script so all it gets is the first failure.

@Steve, I'm not sure what server OS or script language you're using, but if might be worth checking to see if you have got IPv6 enabled or not.

I hope this helps.

Best regards,

Steve

unread,
Jul 4, 2016, 6:26:39 PM7/4/16
to reCAPTCHA
I'm using java httpclient to post json. I modified my code to send application/x-www-form-urlencoded key-vale pairs (like this) and it solved my problem.
Reply all
Reply to author
Forward
0 new messages