social-auth-setup
Skill4 starsChanged 6 months agoMITView on GitHub
Configure Sign in with Apple and Sign in with Google for Supabase Auth. Use when adding social login, troubleshooting OAuth redirects, setting up Apple Services ID, Google OAuth credentials, or linking Google Play Console to Google Cloud.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- apple-appstore-setupSkill
- eas-mobile-deploymentSkill
- edge-functionsSkill
- frontend-developmentSkill
- google-play-setupSkill
- langfuse-tracingSkill
- mobile-developmentSkill
- posthog-analyticsSkill
- push-notificationsSkill
- revenuecatSkill
- sentry-integrationSkill
- stripe-paymentsSkill
- supabase-email-templatesSkill
- template-releaseSkill
- template-upgradeSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Leave as "Enable as a primary App ID" → Save
- Distinctive: line 35
Add your Supabase callback URL:
- Distinctive: line 112
These must all be in the same Google Cloud Project: If your Play Console is linked to Project A but your OAuth credentials are in Project …
- Distinctive: line 120
If you have an existing project: link to it
- Distinctive: line 121
If not: create a new project here
- Distinctive: line 123
After linking, all service accounts for Play Console must be created in this project
- Distinctive: line 131
Search "Google Identity" → Google Identity Toolkit API → Enable
- Distinctive: line 209
Add to Redirect URLs:
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Social Auth Setup (Apple + Google)
Overview
Both providers require setup in three places:
- The provider's developer console (Apple Developer Portal / Google Cloud Console)
- Supabase Auth settings
- Mobile app (
app.json+ Expo config)
Sign in with Apple
Step 1: Enable Sign in with Apple on the App ID
- developer.apple.com/account/resources/identifiers
- Click your App ID (the one matching your
ios.bundleIdentifier) - Scroll to Sign in with Apple → Enable → Edit
- Leave as "Enable as a primary App ID" → Save
Step 2: Create a Services ID (for web/Supabase callback)
This is separate from your App ID — it's used for the OAuth redirect flow.
- Identifiers → + → Services IDs → Continue
- Description:
Your App Name Sign In - Identifier:
com.yourorg.appname.siwa(convention: bundle ID +.siwa) - Register
- Click the new Services ID → Enable Sign in with Apple → Configure
- Add your Supabase callback URL:
- Primary App ID: select your app
- Domains:
YOUR_PROJECT.supabase.co - Return URLs:
https://YOUR_PROJECT.supabase.co/auth/v1/callback
- Save → Continue → Register
Step 3: Create a Private Key
- developer.apple.com/account/resources/authkeys → +
- Name:
Sign in with Apple - Your App - Enable Sign in with Apple → Configure → select your App ID
- Continue → Register
- Download the
.p8file — one-time download, save it - Note the Key ID (10 chars)
Step 4: Configure Supabase
- Supabase Dashboard → Authentication → Providers → Apple
- Fill in:
- Service ID: the Services ID from Step 2 (e.g.
com.yourorg.appname.siwa) - Team ID: your 10-char Apple Team ID (top-right of developer.apple.com)
- Key ID: from the key you downloaded
- Private Key: paste the full contents of the
.p8file
- Service ID: the Services ID from Step 2 (e.g.
- Save
Step 5: Mobile app config
npx expo install expo-apple-authenticationapp.json:
{
"expo": {
"ios": {
"usesAppleSignIn": true
},
"plugins": ["expo-apple-authentication"]
}
}Usage:
import * as AppleAuthentication from "expo-apple-authentication";
import { supabase } from "@/lib/supabase";
const credential = await AppleAuthentication.signInAsync({
requestedScopes: [
AppleAuthentication.AppleAuthenticationScope.FULL_NAME,
AppleAuthentication.AppleAuthenticationScope.EMAIL,
],
});
await supabase.auth.signInWithIdToken({
provider: "apple",
token: credential.identityToken!,
});Note: Apple only returns the user's name and email on the first sign-in. Store them immediately in your DB — they won't come back on subsequent logins.
Sign in with Google
The Google Infrastructure Confusion
Google has two overlapping systems that share the same console:
| Thing | Where | Purpose |
| OAuth Client ID | Google Cloud Console → APIs & Services → Credentials | Sign in with Google |
| Service Account | Google Cloud Console → IAM & Admin | Play Console API (EAS Submit) |
| Play Console API link | Play Console → Setup → API access | Connects Play Console to a Cloud project |
These must all be in the same Google Cloud Project. If your Play Console is linked to Project A but your OAuth credentials are in Project B, social login and Play submissions won't share the project and you'll have permission confusion.
Set up the Cloud project link first, before creating any credentials.
Step 1: Link Google Play Console to Google Cloud (do this first)
- play.google.com/console → Setup → API access
- Click Link to a Google Cloud Project
- If you have an existing project: link to it
- If not: create a new project here
- This link is permanent and one-way — you cannot unlink or change it later
- After linking, all service accounts for Play Console must be created in this project
Step 2: Enable Google Sign-In API
In the linked Google Cloud project:
- console.cloud.google.com → select your project
- APIs & Services → Library
- Search "Google Identity" → Google Identity Toolkit API → Enable
Step 3: Configure OAuth Consent Screen
- APIs & Services → OAuth consent screen
- User type: External (unless you're a Google Workspace org)
- Fill in:
- App name, support email, developer email
- Authorized domains:
supabase.coand your production domain
- Scopes: add
emailandprofile - Save and continue through all steps
Step 4: Create OAuth Client ID
- APIs & Services → Credentials → Create Credentials → OAuth client ID
- For web (Supabase callback):
- Application type: Web application
- Authorized redirect URIs:
https://YOUR_PROJECT.supabase.co/auth/v1/callback - Create → copy Client ID and Client Secret
- For Android (native sign-in):
- Application type: Android
- Package name: your
android.packagefromapp.json - SHA-1 certificate fingerprint (get from EAS):
eas credentials --platform android
- For iOS (native sign-in):
- Application type: iOS
- Bundle ID: your
ios.bundleIdentifierfromapp.json
Step 5: Configure Supabase
- Supabase Dashboard → Authentication → Providers → Google
- Client ID: the web OAuth client ID
- Client Secret: the web OAuth client secret
- Save
Step 6: Mobile app config
npx expo install @react-native-google-signin/google-signinapp.json — add the iOS client ID from Step 4:
{
"expo": {
"plugins": [
["@react-native-google-signin/google-signin", {
"iosUrlScheme": "com.googleusercontent.apps.YOUR_IOS_CLIENT_ID"
}]
]
}
}Usage:
import { GoogleSignin } from "@react-native-google-signin/google-signin";
import { supabase } from "@/lib/supabase";
GoogleSignin.configure({
webClientId: "YOUR_WEB_CLIENT_ID.apps.googleusercontent.com",
iosClientId: "YOUR_IOS_CLIENT_ID.apps.googleusercontent.com",
});
const { idToken } = await GoogleSignin.signIn();
await supabase.auth.signInWithIdToken({
provider: "google",
token: idToken!,
});Supabase Redirect URLs
For both providers, add your app's deep link scheme to Supabase allowed redirect URLs:
- Supabase Dashboard → Authentication → URL Configuration
- Add to Redirect URLs:
https://yourapp.com(production web)yourapp://(mobile deep link — must matchschemeinapp.json)http://localhost:3000(local development)
app.json:
{
"expo": {
"scheme": "yourapp"
}
}Gotchas
Apple login works on simulator but not on device — Sign in with Apple requires a real device. It will always fail on simulator. Test on physical hardware before debugging further.
Apple only sends name/email once — On every subsequent sign-in, credential.fullName and credential.email are null. Save them to your DB on first sign-in:
if (credential.fullName?.givenName) {
await supabase.from("profiles").upsert({ id: userId, name: credential.fullName.givenName });
}Google sign-in fails: "Sign in is currently unavailable" — OAuth consent screen is in "Testing" mode and your email isn't added as a test user. Either add the email in Cloud Console → OAuth consent screen → Test users, or publish the consent screen.
Google Play Console API link: "SA not found" — The service account must exist in the same Google Cloud project that Play Console is linked to. If you created it in a different project, it won't appear. Create a new service account in the correct linked project.
DEVELOPER_ERROR on Android — SHA-1 fingerprint mismatch. The Android OAuth client ID was created with a different SHA-1 than the one EAS uses. Run eas credentials --platform android to get the current SHA-1, then update the Android OAuth client in Google Cloud Console.
Supabase callback URL rejected by Apple — The return URL must exactly match what's in the Services ID configuration, including https:// and no trailing slash. Re-check: https://YOUR_PROJECT.supabase.co/auth/v1/callback.
Google OAuth works on web but not mobile — Mobile uses the native client IDs (Android/iOS), not the web client ID. Make sure you created separate OAuth client entries for Android and iOS in Google Cloud Console and configured them in the app.
Play Console linked to wrong Google Cloud project — This cannot be undone. If you linked to the wrong project, you must use that project for all service accounts. Create the OAuth credentials there too to keep everything in one place.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

