Reputation: 291
Some days ago we have upgraded to Recaptcha Enterprise.
It seems that the only support channel is here on stackoverflow
What mean BROWSER_ERROR in invalidReason?
in the official doc
it's not specified
{
"name": "projects/xxxxxxxxxxxxxxxxxxxxxxx",
"event": {
"token": "xxxxxxx",
"siteKey": "XXXXXXXXXXXXXXXXXXXXXX",
"userAgent": "Mozilla/5.0 (Linux; Android 10; Redmi Note 8T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.105 Mobile Safari/537.36",
"userIpAddress": "XXX.XXX.XXX.XXX",
"expectedAction": "login"
},
"score": 0,
"tokenProperties": {
"valid": false,
"invalidReason": "BROWSER_ERROR",
"hostname": "",
"action": ""
},
"reasons": []
}
Upvotes: 29
Views: 30090
Reputation: 526
I found another (albeit rare) cause to this problem that took me way too long to track down because this wasn't mentioned anywhere else online (that I could find anyways).
After whittling a page down script-by-script and line-by-line until it worked, I tracked the issue down to a JS line similar to this:
document.body.innerHTML = 'Reformatted content generated by a function';
When Google's reCAPTCHA V3 script is loaded, it injects various things into the document body that it needs to do its job. Overwriting the entire body innerHTML is a bad idea, so I put everything inside a <div>
wrapper and rerouted the line to update the innerHTML of that element instead. It finally worked after that.
If your reCAPTCHA .execute()
call is taking 10+ seconds to respond and then generating a token that when validated has a browser-error
response, this might be your issue.
Upvotes: 1
Reputation: 11
I ensured I whitelisted both the backend and the frontend URLs in case they were different; which was my case. You can whitelist here
Upvotes: 1
Reputation: 444
I was experiencing this same error and realised the domain wasn't whitelisted in the reCAPTCHA Enterprise console, which can be accessed here.
After adding the domain, the BROWSER_ERROR
error went away.
Upvotes: 36
Reputation: 96
The non-beta (v1
) version of that page gives this definition:
BROWSER_ERROR - A retriable error (such as network failure) occurred on the browser. Could easily be simulated by an attacker.
(I see the v1beta1
link provided by the OP also contains this definition now, so it may have been updated in the interim.)
Upvotes: 4