Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reCAPTCHA in a local network machine

How can I use Google's reCAPTCHA in a test server on a local network?

According to the documentation:

By default, all keys work on "localhost" (or "127.0.0.1"), so you can always develop and test on your local machine.

My virtual machines however are located on non-localhost local IPs (192.168.XXX.XXX), and adding "localhost" or "127.0.0.1" does not seem to work (the captcha displays an invalid domain error). Is there any way around this?

like image 447
Mahn Avatar asked Feb 09 '15 15:02

Mahn


2 Answers

You can enter a local IP such as 192.168.0.1 into the admin console and will indeed work (you'll have to wait a few minutes for it to apply).

Unfortunately it is limited to only 50 domains so this may not be a solution.

like image 135
Drew Harwell Avatar answered Jan 02 '23 19:01

Drew Harwell


Beside adding the local IP to the admin console (as Drew suggested) enter image description here

you can also (temporarily) disable the origin validation.

go to the admin console

Advanced Settings -> uncheck "Verify the origin of reCAPTCHA solutions"

Verify the origin of reCAPTCHA solutions

Note: If disabled in production - you are required to check the hostname on your server when verifying a solution.

like image 26
ET-CS Avatar answered Jan 02 '23 21:01

ET-CS