reCAPTCHA:“站点所有者错误:站点密钥无效"; [英] reCAPTCHA:"ERROR for site owner: Invalid site key"

查看:160
本文介绍了reCAPTCHA:“站点所有者错误:站点密钥无效";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试按照此处的说明在我的页面上设置 reCAPTCHA.我注册了一个 API 密钥对,并获得了一个公钥和一个私钥.我不清楚应该如何使用私钥,而且我找不到有关它的更多信息.在调用 reCAPTCHA 的页面上似乎没有使用它.

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.

我编辑了我的页面并把

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

在我的 HTML 模板上的 </head> 结束标记之前.

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

我也放了

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

我希望 reCAPTCHA 小部件出现的位置.

where I want my reCAPTCHA widget to appear.

当我加载我的页面时,我收到消息

When I load my page, I get the message

无法联系 reCAPTCHA.请检查您的连接并重试.

Cannot contact reCAPTCHA. Check your connection and try again.

我还看到带有文本的 reCAPTCHA 小部件

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

推荐答案

您需要确保您的站点已添加到您生成 API 密钥并保存的 google reCAPTCHA 页面的域部分.然后再测试.这对我有用.

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.

这篇关于reCAPTCHA:“站点所有者错误:站点密钥无效";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆