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-bazin which there is an OAuth 2 clientId of type Web application - I want to use the external
project-bazclientId 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:
- I set up my Android app in Firebase with its package name and keystore SHA-1 fingerprint in the Settings > General screen.
- I enabled
Googlein Firebase Authentication > Sign-in methods with the Web SDK configuration fromproject-baz - I downloaded the
google-services.jsonfile in Firebase Settings > General screen and pasted it in the Android project - 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