Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate different recaptcha API keys for subdomain?

We'd like to have separate reCaptcha API keys for our development and production environments, but the development site is a subdomain of the production site:

www.mysite.com

dev.mysite.com

From the Google docs, it looks like as soon as we add mysite.com to the captcha domain list, it will use the same API key for all subdomains - is it possible to use set up different API keys for a subdomain?

like image 615
dbcn Avatar asked Oct 17 '22 00:10

dbcn


1 Answers

I was not able to get a subdomain separated out to use a different API key, but Google does provide a sandbox Site Key/Secret pair that can be used to test the recaptcha and not clutter up productions analytics. It's set to always return a valid response, but you can easily modify that response within the application as failed for testing. Test recaptcha key & secret can be found at:

https://developers.google.com/recaptcha/docs/faq

like image 69
dbcn Avatar answered Oct 19 '22 22:10

dbcn