79766342

Date: 2025-09-16 14:43:52
Score: 2.5
Natty:
Report link

Title

Google Sign‑In on Android: Why you must use the Web Client ID (not the Android Client ID) with Credential Manager / Google Identity Services


Question

I was integrating Google Sign‑In in my Android app using Kotlin + Jetpack Compose and the new Credential Manager API with Google Identity Services.

I went to Google Cloud Console → Create Credentials → OAuth Client ID and, since I was building an Android app, I naturally chose Application type: Android. I added my package name and SHA‑1 fingerprint, got the Android Client ID, and used it in:

val googleIdOption = GetGoogleIdOption.Builder()
    .setServerClientId("MY_ANDROID_CLIENT_ID")
    .build()

But I kept getting:

[28444] Developer console is not set up correctly.

After hours of debugging, I discovered that I actually needed to use the Web application client ID in setServerClientId(...), even though my app is Android‑only.

Why is this the case?
What’s the correct way to set up OAuth in Google Cloud so Google Sign‑In works on Android without this error?


Answer

This confusion is extremely common — you’re not alone.
The short version: Google Sign‑In on Android always requires a Web Client ID for ID token retrieval, even if your app is Android‑only.


Why the Web Client ID is required


Correct setup in Google Cloud Console

  1. Create a Web application OAuth client

    • Application type: Web application

    • No need to set redirect URIs for mobile use.

    • Copy the Client ID — this goes into setServerClientId(...) in your Android code.

  2. Create an Android application OAuth client

    • Application type: Android

    • Add your package name and SHA‑1 fingerprint (from ./gradlew signingReport or keytool).

    • This links your signed APK to the same project so Google Play Services trusts it.

  3. Both clients must be in the same Google Cloud project.


Code example

val googleIdOption = GetGoogleIdOption.Builder()
    .setFilterByAuthorizedAccounts(false)
    .setServerClientId("YOUR_WEB_CLIENT_ID") // from Web application type
    .build()

Common pitfalls


Key takeaway

Even for Android‑only apps, you need both:

  • Web Client ID → used in code to request ID tokens.

  • Android Client ID → used to verify your app’s signature with Google Play Services.

This is by design in Google’s OAuth architecture — the Web Client ID represents the “server” side of the flow, even if your “server” is just your backend API.


If you post this, it will save a lot of devs from burning hours on the [28444] error.


Reasons:
  • Blacklisted phrase (1): This link
  • RegEx Blacklisted phrase (1): I want
  • RegEx Blacklisted phrase (0.5): Why is this
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Azharul Islam