Google sign-in
Create Google OAuth clients for your Android and iOS apps and connect them to AppCore for native Sign in with Google.
On this page
Your app signs the user in with Google on the device (google_sign_in), receives a Google ID token, and sends it
to AppCore (POST /v1/auth/social). AppCore verifies the token against Google's published keys, checks the issuer, the
expiry (30 s tolerance) and that the audience is one of your client IDs, and accepts each token only once. Accounts
are keyed by the Google subject ID; a matching email never merges two accounts.
No client secret and no service-account key are needed for this native flow. Console paths are as of 2026-11.
Warning
Not yet enabled: browser sign-in with Google. The browser redirect flow (/v1/auth/oauth/start,
/v1/auth/browser-exchange) returns 503 FEATURE_UNAVAILABLE, and the /api/auth/callback/google route is not
served yet. Use native sign-in on Android and iOS.
Note
Accepted audiences come from the active google_auth connection: its Allowed audiences list, or, if that
is empty, the server, iOS and Android client IDs you entered. A per-environment deployment setting is only a
fallback for development before a connection exists. If neither provides an ID, POST /v1/auth/social with
provider: "google" returns 503 FEATURE_UNAVAILABLE.
Before you begin
- A Google Cloud project owned by your company for this app. You need Owner or Editor on it.
- Your real Android
applicationIdand iOS bundle ID for this environment's build flavor. - The SHA-1 fingerprints of every certificate that signs Android builds you distribute: the Play App Signing key, your upload key and your debug key. Do not guess them.
- Your environment's API host,
https://<your-api-host>.
Steps
Branding. Open Google Cloud console → Google Auth Platform → Branding (older consoles: APIs & Services → OAuth consent screen). Set the app name, user support email, app home page, privacy policy and terms URLs, and your authorized domain.
Audience. In Google Auth Platform → Audience, add test users while you test. Before launch, choose Publish app so the status reads In production. While it is in Testing, only listed test users can sign in.
Web client (its ID is the audience your Android build requests). Go to Google Auth Platform → Clients → Create client → Web application. Name it, then create it. Copy the Client ID (
…apps.googleusercontent.com). You do not need its secret for native sign-in.Android clients. Clients → Create client → Android. Enter the package name and one SHA-1 fingerprint. Create one Android client per signing certificate. Find the Play signing and upload fingerprints in Play Console → your app → Test and release → Setup → App integrity → App signing. Get the debug fingerprint with
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android.iOS client. Clients → Create client → iOS. Enter the bundle ID. Copy the Client ID. In your Xcode project's
Info.plistadd the reversed client ID as a URL scheme,GIDClientID(the iOS client ID) andGIDServerClientID(the web client ID).In AppCore, open Setup and connections → Connections, select the environment, and create a Google Sign-In connection. Fill in the fields below and save.
Run Check syntax. There is no automated read-only check for Google: record the console review as evidence for check
google-config(stageread_only) withPOST /v1/connections/{connection_id}/evidence, then Activate.In your Flutter app, pass the web client ID as
serverClientId:Dartfinal result = await core.auth.signInWithSocial( GoogleSignInBridge(serverClientId: '<web-oauth-client-id>'), );
Paste into AppCore
| AppCore field | Where to find it | Secret? |
|---|---|---|
project_id | Google Cloud console → project picker → Project ID | Public |
server_client_id | Google Auth Platform → Clients → Web client → Client ID | Public |
android_package_name | Your applicationId (Play Console shows it under the app name) | Public |
android_signing_sha1 | Play Console → App integrity → App signing (Play signing + upload), plus your debug keystore | Public |
android_client_ids | Google Auth Platform → Clients → each Android client → Client ID | Public |
ios_bundle_id | Xcode → target → Bundle Identifier | Public |
ios_client_id | Google Auth Platform → Clients → iOS client → Client ID | Public |
allowed_audiences | Every client ID above: web, each Android, iOS | Public |
oauth_publication | Google Auth Platform → Audience → publishing status (Testing or In production) | Public |
server_client_secret | Google Auth Platform → Clients → Web client → Client secrets. Leave empty: only for the browser flow, which is not enabled | Secret (write-only) |
The {api_origin}/api/auth/callback/google redirect URI listed by the connection is for the browser flow. You may
register https://<your-api-host>/api/auth/callback/google on the web client now; it is not used yet.
Verify
- The connection shows Evidence: syntax, then
read_onlyafter your attestation, andpending_approvalonce active in staging. GET https://<your-api-host>/v1/config/publiclistsgoogleinauth_methods.- Sign in on a real Android and iOS build. Record the session as evidence for
google-login(stagesandbox, with the login session asevidence_ref), and attestgoogle-negativeafter checking that a token for another client ID is rejected. The connection then becomessandbox_ready. - The new user appears in Users and access → Users.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
google_sign_in fails on Android with ApiException: 10 (DEVELOPER_ERROR) | No Android client matches the package name and signing SHA-1 of this build | Add an Android client for this exact certificate (debug, upload or Play signing) |
idToken is null on Android | serverClientId not passed, or it is not a web client ID | Pass the web client ID from step 3 |
401 SOCIAL_TOKEN_REJECTED | Audience not accepted, token expired, wrong issuer, or the same token sent twice | Check allowed_audiences and the operator-set audience list contain this client ID; get a fresh token per sign-in |
503 FEATURE_UNAVAILABLE "google sign-in is not configured" | No accepted audiences: the google_auth connection is not active or has no client IDs | Activate the connection with your client IDs in this environment |
google missing from auth_methods | Connection not active | Attest google-config, then Activate |
| Only some Google accounts can sign in | OAuth audience is still Testing | Add them as test users, or publish the app |
| Sign-in creates a second account for the same person | Expected: accounts are keyed by provider subject, never merged by email | Let the user link methods from inside the app (core.auth.linkSocial) |