我正在尝试在我的 Rails 项目中使用 google ReCaptcha enterprise,但出现此错误:
{"error"=>{"code"=>403, "message"=>"The provided cloud project number does not own the given recaptcha key", "status"=>"PERMISSION_DENIED"}}
我有什么:
- 我的项目ID,我是从ID栏下的项目列表中得到的
- reCAPTCHA key (站点 key )和在 reCAPTCHA Enterprise 面板中创建的域
- 已创建 API key here .应用程序限制:无,API 限制:reCAPTCHA Enterprise API
我正在向此端点发布数据:
https://recaptchaenterprise.googleapis.com/v1beta1/projects/#{project_id}/assessments?key=#{API_key}
请求的正文是:
{
event:
{
token: response_token,
siteKey: site_key,
userIpAddress: domain
}
}
最佳答案
正如 OP 在评论部分确认的那样,问题的根本原因是错误的 enterprise key
。
You're right, I was using the v3 site key on the client-side, which means the response_token was wrong. I forgot to update the client-side by enterprise key. thanks man, it works now
错误 The provided cloud project number does not own the given recaptcha key
表示与 key 不匹配。当 OP 更新 client-side
key 时,它开始工作。
关于ruby-on-rails - 谷歌验证码错误 : The provided cloud project number does not own the given recaptcha key,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70241961/