← All guides

Fix Google Sign-In 403 disallowed_useragent in Web Apps

LovableBoltSupabase

Google sign-in works when you open the app in Chrome or Safari, then fails when someone arrives through a link opened inside another app. The screen shows the error disallowed_useragent. This is not a broken Client ID, and it is not a Site URL that still points at localhost. Google is refusing to run its OAuth consent page inside an embedded browser.

This guide is for the owner of a web app, including apps built in Lovable or Bolt: why the block exists, how to confirm it, how to send people to a supported browser, how to keep email or magic-link sign-in available, and what to change if you later wrap the site in a native WebView.

What disallowed_useragent means

Google’s OAuth documentation names the error disallowed_useragent. It means the Google authorization page opened inside an embedded user-agent that Google’s OAuth 2.0 policies do not allow.

Google forbids routing its OAuth 2.0 authorization request through an embedded user-agent the developer controls. In that definition, an embedded user-agent includes software that can inject scripts, change how the request reaches Google’s servers, or read session cookies. The person also has to be able to inspect the address they are connected to, and whether the connection is secure.

Google’s 29 June 2021 Developers Blog post announced that every embedded webview would be blocked at Google’s authorization endpoint starting 30 September 2021. The reasons it gives are security and reliability: the host app can intercept or alter the exchange with Google, hide the site domain, and skip checks a full browser shows. A full-featured browser also keeps password managers, Web Authentication, and multi-step sign-in (including two-step verification and security keys) working.

The same rule appears in Google’s OAuth best practices: on the web, Google OAuth has to start in a full-featured browser, not in an embedded environment such as Android WebView or iOS WKWebView.

Where your users run into it

Two situations show up in Google’s own writing.

Someone else’s app opened your site in an embedded browser. Google’s documentation for client-side web apps says a web developer can hit disallowed_useragent after an Apple-platform app loads an ordinary URL inside an embedded user-agent, and the visitor then starts Google sign-in from your site. The 2021 post adds that a site can be affected by another developer’s choice, and gives the example of a messaging or news app that loads your pages inside its own webview. Google Account Help also lists a browser embedded inside another application among the environments Google may refuse sign-in from.

You do not control that other app. Google’s advice to the site owner in that situation is to contact the other developer. For your own visitors, the practical response is the supported-browser prompt and the fallback sign-in method in the sections below.

Your own wrapper opens the app in a WebView. If you later package the site in an Android WebView, or in iOS WKWebView or the older UIWebView, and start Google sign-in inside that view, the same error appears. That case is on you, and the sanctioned replacements are in Fix 3.

A related, separate case is a captive portal: the 2021 post notes that a network login page can appear inside the system captive-portal webview. Google’s guidance there is to tell people how to open the page in their default browser.

This error is not the same as testing Google sign-in inside a builder preview. Bolt’s Google SSO guide says Google blocks its OAuth flow inside iframes, so confirm sign-in on the live URL opened as a full page, not inside the editor preview. An iframe block and an embedded-webview block are different mechanisms; confirm the published URL in a real browser before you treat a preview failure as disallowed_useragent.

Confirm that an embedded browser is the cause

  1. Open the published app in a supported browser on the same device, such as Chrome, Safari, Firefox, Opera, or Edge, the list in Google Account Help. Complete Google sign-in there.
  2. Open the same published URL from the other app (or from your own WebView) and try Google sign-in again. If the first path works and the second returns disallowed_useragent, the embedded browser is the cause.
  3. Optional, for a wrapper you control: add disallow_webview=true to the query string of the request to Google’s authorization endpoint, https://accounts.google.com/o/oauth2/v2/auth. The 2021 post documented this parameter as a way to see, in advance of 30 September 2021, whether an implementation would be blocked. After that date the block is already in force, so a real embedded webview fails without the parameter. Use it only when you want to confirm that a given environment is classified as an embedded webview. Do not add it to production requests as a required setting.

If Google sign-in also fails in Chrome or Safari, look elsewhere: redirect URIs, Site URL, and allow lists, or the provider setup for your backend. Those checks are in the redirect section below.

Fix 1: send people to a supported browser

For a web app, you cannot turn the other application’s WebView into a compliant browser. You can stop people hitting a dead Google button, and tell them how to continue.

Show a short screen when Google returns disallowed_useragent, or earlier if you can tell the page is running inside another app’s embedded browser. The screen should:

  • State that Google sign-in has to run in a supported browser, not in this in-app view.
  • Name the browsers Google lists: Chrome, Safari, Firefox, Opera, and Edge.
  • Tell the person to use the in-app browser’s “Open in browser”, “Open in Safari”, or share action, or to copy the URL and paste it into one of those browsers, then sign in there.
  • Leave email or magic-link sign-in visible, so they are not stuck if they cannot leave the current view. See Fix 2.

Do not treat user-agent detection as a required Google API. Google does not publish a detection method for site owners. A prompt after the error is enough. A prompt before the button is a convenience when you already know the page is embedded.

In Lovable or Bolt, you can ask the builder to add that screen. For example:

When Google sign-in returns disallowed_useragent, or when the page is running inside another app's embedded browser, show a screen before the Google button. Explain that Google sign-in must be completed in a supported browser (Chrome, Safari, Firefox, Opera, or Edge). Tell the user to open this page with the in-app browser's "Open in browser" or "Open in Safari" action, or to copy the URL into one of those browsers. Keep email or magic-link sign-in available on that screen.

Review the result and test it from a regular browser and from a link opened inside another app.

Google sign-in is not the only method these backends support. A second method that never opens Google’s authorization page will still work inside an embedded browser.

On Lovable’s built-in backend, Google authentication is an additional method. It does not replace email sign-in. You can keep both. Email authentication supports a password, and you can prompt Lovable to add passwordless sign-in, either a link in the email or a numeric code. The valid window for those emails is set under More → Users → Settings → Email, and can be as short as 60 seconds or as long as 24 hours. The numeric code length is between 6 and 8 digits.

If authentication runs in a Supabase project you own, passwordless email sign-in covers Magic Links and email one-time passwords. Email methods, including Magic Links, are on by default. A Magic Link can be used only once. The default rate limit is one Magic Link or OTP request per 60 seconds. The default lifetime is 1 hour. An email OTP is a six-digit code. That expiry control also applies to Magic Links and to the other auth email links. Supabase strongly discourages setting the lifetime above 86,400 seconds, which equals one day.

Bolt’s database authentication settings include email sign-in. Auth messages from that product also cover passwordless email links and numeric codes, along with confirmations and password resets.

A one-time code is the more reliable option inside an embedded browser, because the person stays on your page and types the code. A Magic Link depends on where the email app opens the link; that destination still has to be on your redirect allow list.

Adding email sign-in does not lift Google’s embedded-browser block. People who must use their Google account still need a supported browser, as in Fix 1.

Fix 3: if you wrap the app, use a sanctioned sign-in path

If you wrap the web app in a native shell, do not start Google sign-in inside Android WebView, iOS WKWebView, or UIWebView. Google’s 2021 post and its OAuth best practices are explicit about the replacements:

  • Let ordinary third-party links go through the operating system’s default handler, so they open in the person’s default browser, or in an already-installed app via Android App Links or iOS Universal Links.
  • On Android, you may instead open those links in Custom Tabs. Custom Tabs are served by the person’s preferred browser, share its sign-in state and autofill, and are the path Google’s Play guidance on OAuth in a WebView tells Android developers to migrate to. That Play article describes the migration as recommended, not mandatory, for the Play Console alert it covers. The OAuth policy itself still forbids the WebView flow.
  • On iOS, Google’s 2021 post names SFSafariViewController as a supported way to open ordinary outbound links. For signing a user in through a web service, Apple documents ASWebAuthenticationSession, which presents a system-controlled session and returns the callback only to your app. Apple also notes that ASWebAuthenticationSession is the API to use when data has to pass between your app and Safari.
  • For a native Google sign-in button, use the platform SDK rather than a WebView: the Google Sign-In SDK on iOS or macOS (the iOS client type is required for that SDK), or Sign in with Google through Credential Manager starting at Android 4.4, which is API level 19.

Backend scope matters:

  • Lovable’s built-in backend accepts one Google client ID: Lovable’s own, in Managed by Lovable, or the Web application client you enter under your own credentials. Lovable’s Google auth docs say a native sign-in that uses its own app-specific client ID is not supported on that backend. Open Google’s consent page in the system browser, or in a sanctioned in-app browser tab, and add a custom URL scheme (for example myapp://callback) to the Redirect URLs list in auth settings.
  • Your own Supabase project does document native Sign in with Google for Android, iOS, and macOS, completing the session with signInWithIdToken. On Android, Supabase contrasts that native path with the OAuth flow that needs a web browser, and points at the Credential Manager library. See Sign in with Google.

This page does not walk through store submission or choosing a wrapper. After sign-in works in the system browser or SDK, still confirm that the callback URL is allowed, as in the next section.

What not to do

Do not spoof the user-agent string. The policy is about the browsing environment: whether the host can inject scripts, intercept the request, read cookies, or hide the address and connection security. Changing the label in the user-agent header does not turn an embedded webview into a full-featured browser, and it is not a compliant integration.

Do not hide the error and leave Google as the only sign-in method. Swallowing disallowed_useragent leaves visitors who arrived inside another app with no way to get in.

Do not expect a Google Cloud Console setting to allow embedded webviews. The secure-browser rule is in Google’s OAuth 2.0 policies, which apply to every developer who uses OAuth 2.0 (including OpenID Connect used only for sign-in). Adjusting a Client ID, an authorized redirect URI, or the consent screen does not lift that block. A redirect URI mismatch is a different error; if that is what you see in a regular browser, use the redirect section below.

Check redirect settings once they are in a real browser

After someone opens the app in a supported browser, Google can complete consent. They still have to land back on your site.

That return path is a Site URL and redirect-allow-list problem, not an embedded-webview problem. In a Supabase project, set the Site URL to the live domain and add each post-login destination to the Redirect URLs list, including any redirectTo value in your code. If the app uses Lovable’s built-in backend (Lovable Cloud), those same fields sit in the Advanced section of the auth settings. When you publish, Lovable sets the Site URL to the published address unless that Site URL is already on a domain you own; when you connect a custom domain, Lovable adds it to the Redirect URLs list. You still add any address Lovable does not host, such as a mobile custom scheme. Bolt exposes a Site URL and a URI allow list in its Advanced Authentication options, and it keeps any override you type in.

The full checklist, including the difference between Google’s Authorized redirect URIs and your app’s allow list, is in the localhost redirect guide. Fix disallowed_useragent first, then confirm that checklist on the published domain.

When to get help

Bring in a vetted senior engineer if Google sign-in is how real visitors enter, the error appears only inside other apps, or a native wrapper still opens Google’s consent page in a WebView. They can exercise the arrival routes your traffic actually uses, add a supported-browser screen and a fallback sign-in method, and verify redirects on the published domain. Fixed price, agreed upfront.

Tool pages: Lovable, Bolt, Supabase, or something else. The pre-launch review also covers checking login paths before you go live.

FAQ

Because the other app is opening your site in an embedded browser, and Google’s secure-browser policy does not allow the authorization page to run there. In a supported browser the same app and the same Google client work. Google’s docs describe this as a web site being affected by another developer’s choice to use an embedded webview, for example a messaging or news application.

Can I fix this by changing a setting in Google Cloud Console?

No. There is no Console option that permits Google OAuth in an embedded webview. The block is Google’s secure-browser policy, enforced at the authorization endpoint since 30 September 2021. Console changes to the Client ID, redirect URIs, or consent screen do not override it.

Will adding email sign-in as a fallback solve it?

It gives people a way to sign in without opening Google’s authorization page, so they can finish sign-in even inside an embedded browser. A one-time code is the more reliable of the email options in that situation. It does not make Google sign-in work in the embedded browser. Anyone who needs to use their Google account still has to open the page in a supported browser.

Is this the same as the redirect-to-localhost problem?

No. disallowed_useragent is Google refusing to show its consent page in an embedded browser. Redirecting to localhost, or a redirect URI mismatch, happens after a successful consent (or in the provider’s redirect check) when the Site URL, allow list, or provider callback is wrong. That setup is covered in the localhost redirect guide.

Comments

Add a comment

Generated for you. Click to type your own.

Required. Never shown on the page. Privacy policy.

Basic markdown: **bold**, *italic*, `code`, lists, quotes, and fenced code blocks. HTML shows as plain text.

Your draft stays on this device until you post.