Tuesday 16 May 2023

Google Sign-In "An error has ocurred. That's all we know" inside Instagram's webview

I have integrated the Sign In with Google for Web js API (https://accounts.google.com/gsi/client) into my website.

Everything is working fine, except when the website is loaded inside a WebView in Instagram. In that case, when a user tries to log in and chooses an account, Google shows a webpage with the error "An error has occurred. That's all we know" (see pictures attached at the end).

I suspect that this problem occurs because of some WebView restrictions that Google imposes, preventing users from logging in with Google from WebViews.

To check this assumption, I created a simple Android app to load my website inside a WebView. What I found is that the Google script request (https://accounts.google.com/gsi/client) fails with HTTP status 403, and no additional information is given. Later, I found this in the docs:

403 disallowed_useragent

If you get an error that says “403 disallowed_useragent,” the app uses embedded WebViews. Some developers use WebViews to help display web content in an app. Embedded WebViews put your security at risk because they could let third parties access and change communications between you and Google.

To keep your account secure, Google no longer allows embedded WebViews as of September 30, 2021. What can you do about this error?

Only the third-party developer can fix this issue on the app. Contact the developer directly to tell them about the error.

If the app has a website, you can try to sign in from your browser.

It's strange that the Google button loads in Instagram's WebView but not in mine (even using the same User-Agent). I'm not sure if this is related to the error that is occurring in Instagram's WebView, but it might be.

I have no way of reproducing the error, nor do I have control over making Instagram open my website in the browser. What should I do or investigate next to resolve this issue?

enter image description here

enter image description here

enter image description here



from Google Sign-In "An error has ocurred. That's all we know" inside Instagram's webview

No comments:

Post a Comment