Overview
Adding social sign-in (Apple, Google) to your app provides a seamless authentication experience for users. This guide walks you through setting up OAuth providers with Supabase and integrating them into your MobileCoder app.Prerequisites
You’ll need:- A connected Supabase project
- Access to Google Cloud Console (for Google OAuth)
- An Apple Developer account (for Sign in with Apple)
Setting Up Google Sign-In
Step 1: Create Google OAuth Credentials
1
Open Google Cloud Console
Go to Google Cloud Console and select or create a project.
2
Create OAuth Client
Navigate to APIs & Services → Credentials → Create Credentials → OAuth Client ID.Choose Web application as the application type.
3
Configure Redirect URI
In Supabase, go to Authentication → Providers → Google and copy the Callback URL.Add this URL to the Authorized redirect URIs in Google Cloud Console.
4
Copy Credentials
Copy the Client ID and Client Secret from Google Cloud Console.
Step 2: Configure Supabase
- In Supabase, go to Authentication → Providers → Google
- Enable the Google provider
- Paste your Client ID and Client Secret
- Save the configuration
Step 3: Add to Your App
In MobileCoder, prompt:“Add Google sign-in to the app using Supabase Auth.”The AI will implement the complete Google OAuth flow.
Setting Up Apple Sign-In
Step 1: Configure Apple Developer
1
Enable Sign in with Apple
In Apple Developer, go to Identifiers and select your App ID.Enable the Sign in with Apple capability.
2
Create a Key
Go to Keys → Add Key.Enable Sign in with Apple and configure it for your app.Register the key and download it — you’ll need this file.
3
Note Your Bundle ID
Copy your app’s Bundle ID from the Identifiers section.
Step 2: Configure Supabase
- In Supabase, go to Authentication → Providers → Apple
- Enable the Apple provider
- Enter your Bundle ID as the Client ID
- Upload or paste your key file contents
- Save the configuration
Step 3: Add to Your App
In MobileCoder, prompt:“Add Apple sign-in to the app using Supabase Auth. Use native Sign in with Apple, not a web browser.”
Specifying “native” ensures the AI uses the iOS Sign in with Apple sheet instead of a web-based flow.
Adding Both Providers
To add both Google and Apple sign-in at once:“Add sign-in with Google and Apple using Supabase Auth. For Apple, use native Sign in with Apple.”The AI will create a sign-in screen with both options and handle all the authentication logic.
Testing Authentication
Enable User Signups
In Supabase, go to Authentication → Settings → User Signups and make sure new users can sign up.Test the Flow
- Run your app in the preview or on a device
- Tap the Google or Apple sign-in button
- Complete the OAuth flow
- Check Supabase’s Authentication → Users to see the new user
Troubleshooting
Google opens Safari and fails
Google opens Safari and fails
Make sure user signups are enabled in Supabase Auth settings. Also verify your redirect URI matches exactly.
Apple says 'missing OAuth secret'
Apple says 'missing OAuth secret'
This usually means the flow is using web-based OAuth instead of native. Prompt MobileCoder to “redo Apple sign-in as native only.”
User not appearing in Supabase
User not appearing in Supabase
Check if there are any errors in the browser console. Ensure the OAuth providers are correctly configured with valid credentials.