reCAPTCHA:“ERROR for site owner: Invalid site key”

邮差的信 提交于 2020-08-01 09:26:33

问题


I tried to set up reCAPTCHA, on my page by following the instructions here. I signed up for an API key pair and was issued a public key and a private key. It was not clear, to me, how the private key should be used and I could not find more information about it. It does not appear to be used on the page where reCAPTCHA is called.

I edited my page and put

<script src='https://www.google.com/recaptcha/api.js'></script>

before the closing </head> tag on my HTML template.

I also put

<div class="g-recaptcha" data-sitekey="my-public-key"></div>

where I want my reCAPTCHA widget to appear.

When I load my page, I get the message

Cannot contact reCAPTCHA. Check your connection and try again.

I also see the reCAPTCHA widget with the text

ERROR for site owner: Invalid site key

I have checked similar questions such as this, where the answer says the key is probably invalid but I have just generated it. I also saw this but I did not disable

Verify the origin of reCAPTCHA solutions

回答1:


You need to ensure your site is added in the domains section of the google reCAPTCHA page where you generated the API key and save. Then test again. That worked for me.




回答2:


It wasn't obvious to me initially but you have to supply your site key in 2 places:




回答3:


In my case it was using a wordpress site,

And I had chosen version 3 of captcha and it turns out the wordpress only supported version 2.




回答4:


I'm using Entrepreneur Wordpress theme which came with Formidable. I went to the reCAPTCHA Admin Console and created the Site and Secret Keys for "V2 Checkbox."

At first it wasn't working and I was getting the "ERROR for site owner: Invalid site key" message but figured out that the reason why was because I had put the "http://" before my domain.

After trial and error, I discovered that deleting the old reCAPTCHA for that domain, then creating a new one without the "http://" worked perfectly! Not sure if having or not having the "www." would matter for any other users.

Hope this helps!




回答5:


I also face same problem from google reCAPTCHA console your project uncheck

  1. Verify the origin of reCAPTCHA solutions
  2. Send alerts to owners

both,then see from your contact form, its working from me just try it

Hope this helps!




回答6:


I had this problem with Wordpress Contact Form plugin. Be sure that you have put correct domain at reCAPTCHA configure page. It should be without http:// or https://. For example, google.com. Regenerate api keys and update it in Admin/Contact/Integration. Then you will see recaptcha icon in the page bottom corner




回答7:


Google stopped supporting TLS 1.0, make sure you making request with TLS1.1 or TLS 1.2

Use ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; for .NET 4.5 and lower version




回答8:


I had the same issue with reCAPTCHA v3 on my blog on Wordpres 4.5. When I replaced reCAPTCHA v3 with reCAPTCHA v2 the issue has gone.




回答9:


I removed  following "" from the page and V3 still sending the reply as intended and the error is gone now. Tested and it does work as needed. 




回答10:


For those that maybe made the same mistake as me: DO NOT ENTER HTTP:// OR HTTPS:// at the list of domains, just put in the domain like "example.com" and not https://example.com.



来源:https://stackoverflow.com/questions/48600034/recaptchaerror-for-site-owner-invalid-site-key

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!