2

I'm stuck on this com.google.android.gms.common.api.ApiException: 10 issue and I can't find why. I searched a lot in SO and Google/Firebase doc but it does not help me. I think I'm in a specific configuration need:

  • I have an Android app setup with a Firebase and a Google developer projects (project id project-foobar)
  • there is an external Google developer project project-baz in which there is an OAuth 2 clientId of type Web application
  • I want to use the external project-baz clientId in my Android app because this project belongs to another company which takes care of the OAuth Consent Screen process
  • I need to request an id token to give it to a backend server (as described here)

So this is my current setup:

  1. I set up my Android app in Firebase with its package name and keystore SHA-1 fingerprint in the Settings > General screen.
  2. I enabled Google in Firebase Authentication > Sign-in methods with the Web SDK configuration from project-baz
  3. I downloaded the google-services.json file in Firebase Settings > General screen and pasted it in the Android project
  4. My app calls this:
val signInOptions = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
    .requestEmail()
    .requestIdToken(context.getString(R.string.project_baz_client_id))
    .build()
val client = GoogleSignIn.getClient(context, signInOptions)
startActivityForResult(client.signInIntent, REQUEST_SIGN_IN)

The problem is I receive this exception com.google.android.gms.common.api.ApiException: 10

Any idea?

Edit: I forgot to mention the auth process works fine if I use the OAuth 2 clientId from project-foobar

riot
  • 417
  • 4
  • 15
  • My setup is different but I started getting this same error two days ago in production. – Aditya Kushwaha Apr 17 '20 at 15:18
  • Made mine work - Added the client ids of my prod and debug builds from GCP to Firebase in the list of Whitelisted client ids. – Aditya Kushwaha Apr 18 '20 at 09:49
  • https://stackoverflow.com/a/47620437/10752944 Make sure you have added this – Kartik Apr 20 '20 at 04:37
  • @AdityaKushwaha I also did that but it doesn't help – riot Apr 20 '20 at 14:08
  • @Kartik the SHA-1 fingerprint is set up correctly, I checked several time. And the `google-services.json` file is up-to-date. About the Google Play link in the Firebase project settings, my app is not yet published in the Play Store, so I can't do that – riot Apr 20 '20 at 14:11

0 Answers0