23

I have registered an account on recaptcha.net with mydomain.com.

While I'm developing on my localhost it works fine, but whenever I try to open the page from another machine in my local network it shows "input error: invalid referer" error message!

I'm not using recaptcha plugins.

ehsun7b
  • 4,796
  • 14
  • 59
  • 98

4 Answers4

28

reCaptcha keys are tied to a certain domain + localhost (when you got your private/public keys from them). You can use it on another domain by requesting new private/public keys or by using a global key.

From their website:

  • By default, your reCAPTCHA key is restricted to the specified domain, and any subdomains for additional security. A key for foo.com works on test.foo.com.

  • If you wish to use your key across a large number of domains (e.g., if you are a hosting provider, OEM, etc.), select the global key option. You may want to use a descriptive domain name such as "global-key.mycompany.com"

  • If you own multiple domain names (foocars.com and footrucks.com), you can sign up for multiple keys, or use a global key.

Community
  • 1
  • 1
Nasreddine
  • 36,610
  • 17
  • 75
  • 94
  • damn, so I'm trying to get my pull request approved and the captcha has to work, one of my team mates tried testing, without the captcha being verified the thing doesn't run through without giving that error . . . .the website uses this key, I can't change it. it's been this way for almost 10years now and I've been here for a month, what do I do? :( – pythonian29033 Apr 01 '14 at 08:40
  • sweet, made an if to check if it was running on live or on dev. . .or anything else – pythonian29033 Apr 01 '14 at 14:12
3

It seems that Google has removed the Global Key for reCaptcha, as you can see here.

In your localhost it works fine because your are using the keys provided to your domain. But when you upload the code you your production server, it seems that you are using the same keys to multiple domains (even though localhost might not be considered a domain). So you got that error. I fixed that creating new keys to another domain of mine and adding them to my localhost script. And to the production script, I kept the keys for that domain.

Andre Ravazzi
  • 611
  • 7
  • 10
1

i have the same problem, i solve it to add my server ip adress from recaptcha admin screen;

Click the over your domain name which are listed under header Your reCAPTCHA sites and add your ip at Key Settings -> Domain so problem is solved.

erhun
  • 3,549
  • 2
  • 35
  • 44
0

As Andre mentioned before - the global key was removed for reCaptcha. But you can use secure token You'll find my solution for PHP here

Community
  • 1
  • 1
Hexodus
  • 12,361
  • 6
  • 53
  • 72