Skip to content
Advertisement

reCaptcha: error code “invalid-keys”

I currently implementing the reCaptcha for an form with HTML and PHP. The client-side solution works without any problems. But the server side fails with the validation.

So here is my server side code:

JavaScript

So now when I dump the result I get the following output:

JavaScript

I’m sure that the response code will completly send to the PHP script.

I also searched in the API docs, but only find these error codes and nothing matches with invalid-keys.

What did I wrong?

Advertisement

Answer

So dumb. I took the secret key from the wrong project from the admin console. The wrong project not white listed localhost, which I needed. Also the public-site-key and secret-key were mismatched (but both individually valid).

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement