Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https://www.google.com/recaptcha/api2/pat 401 (Unauthorized) #561

Open
arebelof opened this issue Sep 25, 2024 · 20 comments
Open

https://www.google.com/recaptcha/api2/pat 401 (Unauthorized) #561

arebelof opened this issue Sep 25, 2024 · 20 comments

Comments

@arebelof
Copy link

Hi,

When I have the Chrome's Device Toolbar active (CTRL + SHIFT + M), I'm getting this error on console when loading the page:

recaptcha__pt.js:805
POST https://www.google.com/recaptcha/api2/pat?k= 401 (Unauthorized)

If I disable the device tollbar, there's no error.

image

image

image

Thank you.

@mchamma
Copy link

mchamma commented Oct 2, 2024

Same

@borisb13
Copy link

borisb13 commented Oct 5, 2024

same here

@guncv
Copy link

guncv commented Oct 7, 2024

same here how to solve it

@andrewhood
Copy link

Same

@Berman59
Copy link

Same!

@TomerSH17
Copy link

Same :(

@notKamui
Copy link

Please stop saying "Same" like parrots. You're polluting the issue thread. Instead, upvote the initial comment, and subscribe to the issue

Image

@cududa
Copy link

cududa commented Oct 21, 2024

Additionally, I've noticed that when I use Safari dev tools to remotely connect to my iPhone and pull up dev tools in Safari, it seems this error occurs on every load

@jeremy-hunter
Copy link

cududa - thank you for sharing, that totally cleared everything up for me

Overriding the user agent without enabling device mode will still exhibit the same behavior

This user agent value does NOT exhibit this behavior in chrome's dev tools
Mozilla/5.0 (iPhone; CPU iPhone OS 13_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/129.0.0.0 Mobile/15E148 Safari/604.1
Image

This user agent value DOES exhibit this behavior in chrome's dev tools
Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1
Image

@cududa
Copy link

cududa commented Oct 30, 2024

@jeremy-hunter

Yes, different user agents change the in dev tools - but in prod, testing on a real device I still get a 401.

I'm hoping Google doesn't close this issue, as it appears recaptcha just won't load on recent iOS versions and there's no guidance or documentation on the issue.

@NareshRoka
Copy link

Seems like the problem start when user agent has iPhone OS 16_0 and above. Its working fine till version iPhone OS 15_8.

@dbrisson-passat
Copy link

anyone has solved this issue please ?

@Rick-EESCOC
Copy link

Rick-EESCOC commented Nov 4, 2024

I see this issue on Safari Version 17.5 (19618.2.12.11.6)
Is this because of CORS?

Cross-Origin-Opener-Policy-Report-Only: same-origin;
Image

Also noticing other CSS and JS is returning a 401 response.
Request
Accept: /
Cache-Control: no-cache
Pragma: no-cache
Referer: https://www.google.com/
Sec-Fetch-Dest: script
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15

Request
Accept: /
Cache-Control: no-cache
Pragma: no-cache
Referer: https://www.google.com/
Sec-Fetch-Dest: script
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15

Image

Working on Chrome 130.0.6723.92 (Official Build) (x86_64)

Working on Chrome Canary 132.0.6817.0
Request URL:
https://www.gstatic.com/recaptcha/releases/-ZG7BC9TxCVEbzIO2m429usb/recaptcha__en.js
Request Method:
GET
Status Code:
200 OK
Remote Address:
142.251.215.227:443
Referrer Policy:
strict-origin-when-cross-origin

Response Headers
accept-ranges:
bytes
access-control-allow-origin:
*
age:
924
alt-svc:
h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
cache-control:
public, max-age=31536000
content-encoding:
gzip
content-length:
220347
content-security-policy-report-only:
require-trusted-types-for 'script'; report-uri https://csp.withgoogle.com/csp/recaptcha
content-type:
text/javascript
cross-origin-opener-policy:
same-origin-allow-popups; report-to="recaptcha"
cross-origin-resource-policy:
cross-origin
date:
Mon, 04 Nov 2024 18:58:56 GMT
expires:
Tue, 04 Nov 2025 18:58:56 GMT
last-modified:
Tue, 22 Oct 2024 00:01:33 GMT
report-to:
{"group":"recaptcha","max_age":2592000,"endpoints":[{"url":"https://csp.withgoogle.com/csp/report-to/recaptcha"}]}
server:
sffe
vary:
Accept-Encoding
x-content-type-options:
nosniff
x-xss-protection:
0
Request Headers:
:authority:
www.gstatic.com
:method:
GET
:path:
/recaptcha/releases/-ZG7BC9TxCVEbzIO2m429usb/recaptcha__en.js
:scheme:
https
accept:
/
accept-encoding:
gzip, deflate, br, zstd
accept-language:
en-US,en;q=0.9
cache-control:
no-cache
origin:
https://.com
pragma:
no-cache
referer:
https://.com/
sec-ch-ua:
"Not A(Brand";v="8", "Chromium";v="132", "Google Chrome";v="132"
sec-ch-ua-mobile:
?1
sec-ch-ua-platform:
"Android"
sec-fetch-dest:
script
sec-fetch-mode:
cors
sec-fetch-site:
cross-site
user-agent:
Mozilla/5.0 (Linux; Android 13; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36
x-client-data:
CI+2yQEIo7bJAQirncoBCMv4ygEIlqHLAQia/swBCNX0zQEI4LrOAQjIws4BCJPEzgEI48XOAQiOxs4BCPHGzgEInMjOARiYr80B
Decoded:
message ClientVariations {
// Active Google-visible variation IDs on this client. These are reported for analysis, but do not directly affect any server-side behavior.
repeated int32 variation_id = [3300111, 3300131, 3313323, 3325003, 3330198, 3358490, 3373653, 3382624, 3383624, 3383827, 3384035, 3384078, 3384177, 3384348];
// Active Google-visible variation IDs on this client that trigger server-side behavior. These are reported for analysis and directly affect server-side behavior.
repeated int32 trigger_variation_id = [3364760];
}

Working on Firefox latest build. 132.0

Not checking other Chromium browsers.

@nstiac
Copy link

nstiac commented Dec 8, 2024

Same here .. confirmed it happens only with iphone user agent .. but still happening.

@kemalkastrataj
Copy link

Same here .. confirmed it happens only with iphone user agent .. but still happening.

I can confirm this; it is the same issue on my sites.

@dbrisson-passat
Copy link

anyone have a solution for this issue or no?

@jasminmistry
Copy link

Is there any temporary solution for this?

@geanfarias
Copy link

geanfarias commented Jan 8, 2025

is there some update?

@elielson-anjos
Copy link

elielson-anjos commented Jan 10, 2025

Peas as always breaking everything and the developers has to fix theyr s*****. Any fix on this? This is a super bad bug... Gonna have to disable App Check while this isn't fixed.

@tommag21
Copy link

I wouldn't expect an answer in this repostory. I opened a discussion in the Google Cloud Security forums If anyone wants to contribute: https://www.googlecloudcommunity.com/gc/reCAPTCHA/reCAPTCHA-initialization-error-on-Safari-iOS-16/td-p/859376

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests