繁体   English   中英

Google reCAPTCHA 错误:提供的云项目编号不拥有给定的 reCAPTCHA 密钥

[英]Google reCAPTCHA error: The provided cloud project number does not own the given recaptcha key

我正在尝试在我的 rails 项目中使用 google ReCaptcha 企业,但出现此错误:

{"error"=>{"code"=>403, "message"=>"The provided cloud project number does not own the given recaptcha key", "status"=>"PERMISSION_DENIED"}}

我有的:

  • 我的项目ID,我是从ID栏下的项目列表中得到的
  • reCAPTCHA 密钥(站点密钥)和在 reCAPTCHA Enterprise 面板中创建的域
  • An API Key created here https://console.cloud.google.com/apis/credentials , Application restrictions: none, API restrictions: 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

你是对的,我在客户端使用 v3 站点密钥,这意味着 response_token 是错误的。 我忘了通过企业密钥更新客户端。 谢谢大佬,现在可以了

错误The provided cloud project number does not own the given recaptcha key ,表示该密钥不匹配。 当 OP 更新client-side密钥时,它开始工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM