Google OAuth
Google Sign-In lets users authenticate with their Google account. It’s widely trusted and many users prefer it for its convenience.Overview
Setting up Google OAuth requires configuration in three places:- Google Cloud Console — Create OAuth credentials
- Supabase Dashboard — Enable Google as an auth provider
- Your App — Configure the redirect URI and use the auth function
Part 1: Google Cloud Console
Step 1: Create a Project (if needed)
1
Open Google Cloud Console
Go to console.cloud.google.comSign in with your Google account
2
Create or select a project
Click the project dropdown at the topClick New Project or select an existing oneGive it a name (e.g., “Your App Name”)
Step 2: Configure OAuth Consent Screen
Before creating credentials, you need to configure what users see when they sign in.1
Open OAuth consent screen
Go to APIs & Services → OAuth consent screenDirect link
2
Select user type
Choose External (unless you’re building for a Google Workspace organization)Click Create
3
Fill in app information
Click Save and Continue
4
Scopes
Click Add or Remove ScopesSelect:
.../auth/userinfo.email.../auth/userinfo.profileopenid
5
Test users (optional)
While in testing mode, add your email as a test userClick Save and Continue
6
Summary
Review and click Back to Dashboard
Step 3: Create OAuth Credentials
1
Open Credentials
Go to APIs & Services → CredentialsDirect link
2
Create OAuth client ID
Click + Create Credentials → OAuth client ID
3
Configure for iOS
Click Create
4
Save your Client ID
Copy the Client ID — you’ll need this for SupabaseIt looks like:
123456789-abc123def456.apps.googleusercontent.com5
Create Web client (for Supabase)
Click + Create Credentials → OAuth client ID again
Click CreateCopy both the Client ID and Client Secret
Part 2: Supabase Dashboard
Enable Google Provider
1
Open Auth settings
Go to your Supabase project dashboardNavigate to Authentication → Providers
2
Enable Google
Find Google in the list and click to expandToggle Enable Sign in with Google
3
Enter credentials
Use the Web application credentials (not iOS):
4
Save
Click Save
Part 3: App Configuration
Step 1: Update App Config
Updateconfig/app.config.ts:
Step 2: Configure Redirect URI
Inlib/auth.ts, update the scheme in signInWithGoogle() to match your app:
app.json:
Step 3: Use in Your App
Testing
Development Build Required
Google OAuth requires a development build — it won’t work in Expo Go.Testing Checklist
- Build and install the development build
- Tap “Sign in with Google”
- Browser opens with Google’s sign-in page
- Sign in with a test user account
- You’re redirected back to the app
- User is authenticated
Troubleshooting
'redirect_uri_mismatch' error
'redirect_uri_mismatch' error
The redirect URI in Google Console must exactly match what your app sends.
- Check the redirect URI in Credentials → Web client → Authorized redirect URIs
- It should be:
https://YOUR_PROJECT_REF.supabase.co/auth/v1/callback - No trailing slash, exact case match
'access_denied' error
'access_denied' error
- If using External user type, ensure your Google account is added as a test user
- Or publish your OAuth consent screen to production
Browser opens but nothing happens
Browser opens but nothing happens
- Check your app scheme matches in
app.jsonand the auth code - Ensure you’re using a development build, not Expo Go
'invalid_client' error
'invalid_client' error
- Verify you’re using the Web client credentials in Supabase (not iOS)
- Double-check the Client ID and Client Secret are correct
Publishing to Production
Before launching your app:1
Publish OAuth consent screen
Go to OAuth consent screen in Google Cloud ConsoleClick Publish AppThis removes the “test user” restriction
2
Verify your app (optional)
If you’re requesting sensitive scopes, Google may require verificationFor basic profile/email scopes, this is usually not required
Next Steps
Apple Sign In
Required if you offer Google Sign-In
Email + Password
Add traditional email authentication