Skip to content
Providers

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 applicationId and 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

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. iOS client. Clients → Create client → iOS. Enter the bundle ID. Copy the Client ID. In your Xcode project's Info.plist add the reversed client ID as a URL scheme, GIDClientID (the iOS client ID) and GIDServerClientID (the web client ID).

  6. In AppCore, open Setup and connections → Connections, select the environment, and create a Google Sign-In connection. Fill in the fields below and save.

  7. Run Check syntax. There is no automated read-only check for Google: record the console review as evidence for check google-config (stage read_only) with POST /v1/connections/{connection_id}/evidence, then Activate.

  8. In your Flutter app, pass the web client ID as serverClientId:

    Dart
    final result = await core.auth.signInWithSocial(
      GoogleSignInBridge(serverClientId: '<web-oauth-client-id>'),
    );

Paste into AppCore

AppCore fieldWhere to find itSecret?
project_idGoogle Cloud console → project picker → Project IDPublic
server_client_idGoogle Auth Platform → Clients → Web client → Client IDPublic
android_package_nameYour applicationId (Play Console shows it under the app name)Public
android_signing_sha1Play Console → App integrity → App signing (Play signing + upload), plus your debug keystorePublic
android_client_idsGoogle Auth Platform → Clients → each Android client → Client IDPublic
ios_bundle_idXcode → target → Bundle IdentifierPublic
ios_client_idGoogle Auth Platform → Clients → iOS client → Client IDPublic
allowed_audiencesEvery client ID above: web, each Android, iOSPublic
oauth_publicationGoogle Auth Platform → Audience → publishing status (Testing or In production)Public
server_client_secretGoogle Auth Platform → Clients → Web client → Client secrets. Leave empty: only for the browser flow, which is not enabledSecret (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_only after your attestation, and pending_approval once active in staging.
  • GET https://<your-api-host>/v1/config/public lists google in auth_methods.
  • Sign in on a real Android and iOS build. Record the session as evidence for google-login (stage sandbox, with the login session as evidence_ref), and attest google-negative after checking that a token for another client ID is rejected. The connection then becomes sandbox_ready.
  • The new user appears in Users and access → Users.

Troubleshooting

SymptomLikely causeFix
google_sign_in fails on Android with ApiException: 10 (DEVELOPER_ERROR)No Android client matches the package name and signing SHA-1 of this buildAdd an Android client for this exact certificate (debug, upload or Play signing)
idToken is null on AndroidserverClientId not passed, or it is not a web client IDPass the web client ID from step 3
401 SOCIAL_TOKEN_REJECTEDAudience not accepted, token expired, wrong issuer, or the same token sent twiceCheck 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 IDsActivate the connection with your client IDs in this environment
google missing from auth_methodsConnection not activeAttest google-config, then Activate
Only some Google accounts can sign inOAuth audience is still TestingAdd them as test users, or publish the app
Sign-in creates a second account for the same personExpected: accounts are keyed by provider subject, never merged by emailLet the user link methods from inside the app (core.auth.linkSocial)