The previous version of reCAPTCHA provided the option to make a global key which would work on any domain. Now, in version 2, that option is gone, and the reCAPTCHA site claims that "Global Keys are not supported in the V2 API."
I'm working with a large number of domain names that can change frequently without my intervention, and I don't want to have to add each new domain to the key.
Is there a way to get reCAPTCHA to work on any domain without specifically authorizing each one?
NOTE: This applies to a previous version of the reCAPTCHA API. See the other answer for an updated solution.
This doesn't seem to be well-known, but reCAPTCHA's documentation mentions that a Secure Token can be used to have one key working on a large number of domains. This feature seems to be exactly designed for this type of situation.
It's created by encrypting a JSON string with your site secret, but the documentation doesn't say exactly what encryption method to use. Here's some PHP code I've used to get it working in one of my projects. This should help with whatever language you're working with.
It is possible to implement reCAPTCHA Version 2.0 without verifying each domain: https://developers.google.com/recaptcha/docs/domain_validation
To do so, visit the admin console and click the API key in question under "Your reCAPTCHA Sites". Then under "Advanced Settings", uncheck "Verify the origin of reCAPTCHA solutions".
Security Warning
Per Google, doing this creates a security risk that then requires you to check the hostname yourself.
Related Link: (from "Stack Exchange Information Security")
- Why bother validating the hostname for a Google Recaptcha response?