OAuth uses SFSafariViewController or Custom Tabs, not embedded WebView
Why it matters
An embedded WebView used for OAuth credential entry violates Apple's guideline 5.1.1 and the OAuth 2.0 security model: the app can read the WebView's DOM content, giving it access to the user's credentials on the OAuth provider's login page. CWE-522 (insufficiently protected credentials) applies directly. Google, Apple, and GitHub explicitly prohibit embedded WebView OAuth because it enables phishing — an app can silently capture the username and password typed into what appears to be Google's login form. The correct implementations (SFSafariViewController, AuthenticationSession, Chrome Custom Tabs) operate in a separate process the app cannot read.
Severity rationale
Low because the pattern requires an OAuth flow to be present and is not an immediate binary rejection in all cases, but Apple has started rejecting it more consistently under guideline 5.1.1.
Remediation
Replace any WebView OAuth flow with expo-auth-session, which uses SFSafariViewController on iOS and Chrome Custom Tabs on Android.
// src/screens/LoginScreen.tsx
import * as Google from 'expo-auth-session/providers/google';
export default function LoginScreen() {
const [request, response, promptAsync] = Google.useAuthRequest({
clientId: process.env.EXPO_PUBLIC_GOOGLE_CLIENT_ID,
});
useEffect(() => {
if (response?.type === 'success') {
const { authentication } = response;
// exchange authentication.accessToken for your session
}
}, [response]);
return <Button title="Sign in with Google" onPress={() => promptAsync()} />;
}
For Apple Sign In (required when offering any third-party sign-in on iOS), use expo-apple-authentication. Never use a <WebView source={{ uri: 'https://accounts.google.com/...' }} /> for credential entry.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the App Store Review Blockers Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-522 — Insufficiently Protected Credentials
- external · apple-guideline-5.1.1-oauth-webview — Apple App Store Review Guideline 5.1.1 — OAuth Must Use System Browser, Not Embedded WebView
Taxons
History
- 2026-04-18·v1.0.0·Initial import from app-store-review-blockers·automated