Repository navigation
SETUP_GOOGLE
Everything you need in the Google Cloud Console and the Supabase dashboard before native Google sign-in will work. Follow it top to bottom — several steps depend on values produced earlier.
The one mistake everyone makes: the library wants the Web client id, not the Android or iOS one. Both Supabase GoTrue and the Android Credential Manager verify against the Web client id. Supplying the Android id compiles, builds and installs fine, then fails at runtime with an opaque provider error. If sign-in fails and nothing looks wrong, check this first.
- Open the Google Cloud Console and create (or select) a project.
-
APIs & Services → OAuth consent screen:
- User type: External unless you have a Workspace-only audience.
- App name, support email, developer contact — these are shown to users, so use real values.
- Scopes:
email,profile,openidare enough. Adding more triggers Google verification.
- While in testing, add your own account under Test users or sign-in will be refused.
You need up to three, and they are not interchangeable.
APIs & Services → Credentials → Create credentials → OAuth client ID → Web application.
- Authorised redirect URI:
https://<your-project-ref>.supabase.co/auth/v1/callback
Copy the Client ID and Client secret. This client id is:
- what you pass as
googleWebClientIdinKmpSupabaseAuthConfig - what Android's Credential Manager uses as its
serverClientId - what you paste into Supabase's Google provider config
Create credentials → OAuth client ID → Android.
- Package name: your application id.
- SHA-1 certificate fingerprint.
You need one Android client per signing certificate, and most apps have at least three:
| Certificate | Where to get the SHA-1 |
|---|---|
| Debug | keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android |
| Release (upload) | keytool -list -v -keystore <your-upload>.jks -alias <alias> |
| Release (app signing) | Play Console → your app → Setup → App signing → App signing key certificate |
Play App Signing is the classic trap. If you use it, Google re-signs your app with a different key than your upload key. Register the app signing SHA-1 too, or sign-in works for every internal build and fails for everyone who installs from the Play Store.
Also register SHA-256 — some Google services require it, and adding it now costs nothing.
You never reference the Android client id in code. Its existence is what authorises the package plus certificate pair.
Create credentials → OAuth client ID → iOS. Bundle id = your app's. Pass the resulting id as
googleIosClientId.
Authentication → Providers → Google:
- Enable the provider.
- Client ID and Client Secret: the values from the Web client (2a).
- Save.
Authentication → URL Configuration → Redirect URLs — add your app's callback:
myapp://login-callback
This must match KmpSupabaseAuthConfig.redirectUrl exactly. GoTrue refuses any redirect not on this
allowlist, and the resulting error does not name the allowlist as the cause.
Keep the client id out of source control — read it through BuildKonfig or an equivalent:
KmpSupabaseAuthConfig(
projectRef = "your-project-ref",
googleWebClientId = BuildKonfig.GOOGLE_OAUTH_WEB_CLIENT_ID,
redirectUrl = "myapp://login-callback",
)Leaving googleWebClientId blank is safe: the library skips the native flow and falls back to the
OAuth redirect rather than throwing. That is deliberate, so a half-configured project still runs.
Needed only for the OAuth-redirect path (which on Android means Apple sign-in, since Google is
native). cmp-supabase-auth ships the intent-filter in its androidMain manifest and it merges into your
app automatically — you do not add anything. See SETUP_APPLE.md.
Run the sample app (sample-app/) against your project before touching your own app — it isolates
console configuration from app wiring.
- Web client id set in Supabase's Google provider
- Android client registered for every signing certificate, Play App Signing included
- iOS client registered, bundle id matches
- Redirect URL in the Supabase allowlist, identical to
redirectUrl -
googleWebClientIdis the Web id - Sample app reaches a signed-in state on a physical Android device
| Symptom | Cause |
|---|---|
| Sheet opens, then "something went wrong" | Wrong client id — Android's instead of Web's |
| Works on debug, fails from Play Store | Play App Signing SHA-1 not registered |
| Sign-in succeeds but the app stays on the spinner | UI keyed on the provider callback instead of the session stream — see cmp-supabase-auth-compose |
redirect_uri_mismatch |
Callback URL missing from Supabase's allowlist, or differs from redirectUrl
|
| Nothing happens on tap |
googleWebClientId blank — the library degraded to OAuth redirect by design |
-
Getting started
-
Provider setup
-
Modules
-
Reference
-
Project