Skip to main content

I encountered a problem about Google reCAPTCHA access.
I created a new site-key for reCAPTCHA on Android and obtained a token.
Now the problem is on the PHP server. When I verify the token, I get an error message: ACCESS_TOKEN_SCOPE_INSUFFICIENT.
I tried many ways to handle it, but it still gives an error message. Please help me solve it.
Detailed error message:
CreateAssessment() call failed with the following error: Google\\ApiCore\\ApiException: {
"reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
"domain": "googleapis.com",
"errorInfoMetadata": {
"service": "recaptchaenterprise.googleapis.com",
"method": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateAssessment"
},
"message": "Request had insufficient authentication scopes.",
"code": 7,
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com\\/google.rpc.ErrorInfo",
"reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
"domain": "googleapis.com",
"metadata": {
"service": "recaptchaenterprise.googleapis.com",
"method": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateAssessment"
}
}
]
}

Hi, this appears to be an issue with how your PHP server authenticates with OAuth

 

Information about OAuth can be found here

https://developers.google.com/identity/protocols/oauth2

 

The OAuth 2.0 scope for the reCAPTCHA Enterprise API is

https://www.googleapis.com/auth/cloud-platform

 

https://developers.google.com/identity/protocols/oauth2/scopes#recaptchaenterprise


Reply