Google Recaptcha V3站点验证没有返回分数属性。

huangapple go评论48阅读模式
英文:

Google Recaptcha V3 site verify does not return score property

问题

我正在尝试使用Google的Recaptcha V3来测试服务器端请求是否来自非机器人。我的URL请求到Google如下:

POST https://www.google.com/recaptcha/api/siteverify?secret=XXX&response=XXX

据我了解,每个响应应该在0到1之间排名得分,但响应只有3个属性。

{
"success": true,
"challenge_ts": "2023-06-11T15:57:32Z",
"hostname": "testkey.google.com"
}

我是否漏掉了任何参数?

英文:

I am trying to use Google's Recaptcha V3 to test whether the server side request is non robot.
My Url request to Google is:

POST https://www.google.com/recaptcha/api/siteverify?secret=XXX&response=XXX

As I understand each response should be ranked a score between 0-1, but the
response has only 3 properties.

{
    "success": true,
    "challenge_ts": "2023-06-11T15:57:32Z",
    "hostname": "testkey.google.com"
}

Am I missing any parameters?

答案1

得分: 1

根据reCAPTCHA验证文档中的具体说明,分数不包含在响应参数中。

您可能已经阅读了reCAPTCHA v3文档中的响应格式,该文档中提到分数是其中之一。这个文档页面与前面提到的文档存在矛盾,因此我认为分数字段未显示,但可能有人忘记更新reCATPCHA v3页面上的文档。

另一方面,您确定您的站点密钥和秘密密钥属于v3 reCAPTCHA API吗?因为您使用的版本取决于密钥对的版本。

英文:

According to the specific docs on reCAPTCHA verification, the score is not on the responses parameters.

You probably read the response format on reCAPTCHA v3 docs, which says that the score is one of the params. This page of the docs contradicts the previously mentioned, so I think that the score field is not shown but someone forgot to update the docs on reCATPCHA v3 page.

On the other hand, are you sure your site-key and secret-key belong to the v3 reCAPTCHA api? Because the version you use depends on the version of the key pair.

huangapple
  • 本文由 发表于 2023年6月12日 00:05:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/76451333.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定