# Google OAuth: Error 403: disallowed_useragent (sign-in from an embedded WebView)

**Code:** `disallowed_useragent` · **Category:** Authentication · **Seen on:** REST API

Google blocks OAuth sign-in inside embedded WebViews (in-app browsers, Electron BrowserWindow, React Native WebView).

## Meaning

Google requires the system browser or Custom Tabs/ASWebAuthenticationSession for OAuth. In-app browsers of social apps (Instagram, Facebook) also trigger it when users open your site there.

## Common causes

- OAuth inside WKWebView/Android WebView/Electron
- Link opened in Instagram/Facebook/LinkedIn in-app browser
- Custom user agent spoofing

## Quick fix

1. Use AppAuth / ASWebAuthenticationSession / Custom Tabs
2. In web apps, detect in-app browsers and ask users to open in the system browser
3. Use Google’s native sign-in SDKs

## Detailed fix by platform

### Swift

1. 

```bash
let session = ASWebAuthenticationSession(url: authURL, callbackURLScheme: "com.example.app") { url, error in /* handle */ }
session.presentationContextProvider = self
session.start()
```


## How to diagnose

1. **Context** — WebView or system browser?
2. **Source** — In-app browser of another app?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/auth/google-disallowed-useragent)
