Google sign-in blocked with 403 disallowed_useragent inside an app
disallowed_useragentShort answer
Google refuses OAuth sign-in screens that load inside an embedded browser such as a WebView. The error means your sign-in page was opened by an app, not by the real browser. Send the authorization request to the system browser or an in-app browser tab, and let the user's own browser handle the link.
Fix it fast
1Find out which cause you have
Find out where the login page is rendering. Open the same URL in Safari or Chrome directly. If it works there and fails only from inside an app, the embedded browser is the cause.
# Open this in a normal browser tab, not inside any app: https://your-app.example.com/login2Match what you see, then jump to its fix
- 1
Error appears only in your mobile or desktop app; the same login works in a normal browserYour own native app starts the sign-in in a WebViewFix - 2
Sign-in fails only when the link is opened from a messaging, social or other app's built-in browserYour web page is opened inside another app's embedded browserFix
- 1
What does the error look like?
disallowed_useragent
Cause 1 of 2
Your own native app starts the sign-in in a WebView
1Check
Search the app for the component that loads the authorization URL, such as WKWebView on iOS or a WebView on Android. Google disallows OAuth requests to its servers from embedded user-agents that the developer controls.
# iOS project
grep -R "WKWebView" --include=*.swift .
# Android project
grep -R "WebView" --include=*.kt --include=*.java .2Fix
Use the system browser for the authorization request. On iOS use Google Sign-In or AppAuth, on desktop open the system browser with a local loopback redirect, and on mobile an in-app browser tab (SFSafariViewController or Chrome Custom Tabs) is accepted.
# Desktop (loopback): the app starts a listener on a random free port,
# opens the system browser to the authorization URL, and sets
# redirect_uri to http://127.0.0.1:<port>3Verify
Sign in from the app: the Google account chooser now opens in the browser or tab and returns to the app.
# Manual check: complete one sign-in on a clean installConfirmed by developers.google.com
Cause 2 of 2
Your web page is opened inside another app's embedded browser
1Check
A web login page is not itself the problem. When a user taps your link inside an iOS or macOS app that opens it in an embedded browser, Google still sees an embedded user-agent. Check from which app the failing users arrive.
# Log the User-Agent header on your login route and compare failing and working sessions2Fix
Tell the user to open the page in the default browser, and when you control the linking app, open links with the OS default handler or SFSafariViewController instead of a web view.
<!-- Shown when the page detects an in-app browser -->
<p>Open this page in Safari or Chrome to sign in with Google.</p>3Verify
Open the same link in the system browser and sign in.
# Manual check: sign in again from Safari or ChromeConfirmed by developers.google.com
How do I stop it coming back?
- Never put an OAuth authorization URL inside a WebView you control; use the system browser or AppAuth.
- Test every sign-in flow on a real device from a clean install before release.
- If you share login links in messages, add a line telling people to open them in their default browser.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Web apps
React Native Android red screen: Unable to load script
Unable to load script
The app could not fetch its JavaScript.
3 causes, each with a fixWeb apps
tsconfig rejects allowImportingTsExtensions
An error that allowImportingTsExtensions needs noEmit or emitDeclarationOnly
allowImportingTsExtensions lets files import each other with .ts or .tsx extensions, and TypeScript only allows it together with noEmit or emitDeclarationOnly.
2 causes, each with a fixWeb apps
AuthUserPoolException: Auth UserPool not configured in a Next.js app
Auth UserPool not configured
The error means an Amplify Auth call ran before Amplify.configure did.
3 causes, each with a fixWeb apps
Module not found for antd/dist/antd.less after upgrading to Ant Design 5
Module not found: Error: Can't resolve 'antd/dist/antd.less'
Ant Design 5 dropped Less and the bundled CSS file for CSS-in-JS, so antd/dist/antd.less no longer exists.
3 causes, each with a fixWeb apps
Apollo Server rejects a request as a potential CSRF
HTTP 400 Bad Request from the GraphQL endpoint
Apollo Server's CSRF prevention is on by default.
3 causes, each with a fixWeb apps
Apollo Client is blocked by CORS when the GraphQL server runs on AWS Lambda
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Apollo Server does not set CORS for you when it runs behind a framework or integration, and on Lambda that layer is API Gateway.
5 causes, each with a fix