我正在使用Google登录,然后使用signInWithCredential传递Google凭据在Firebase上进行身份验证。
我遵循了所有程序,一切正常!突然,它停止工作了。我去了以前的工作代码,它仍然失败。因此,似乎数据库配置发生了一些事情。
在Firebase DB中,我已经检查过:
Google登录成功后,错误消息如下,因为我是通过在侦听器中使用task.getException从try-catch获得的:
com.google.firebase.FirebaseException: An internal error has occurred. [ Invalid Idp Response: the Google id_token is not allowed to be used with this application. Its audience (OAuth 2.0 client ID) is XXXXX-XXXXX.apps.googleusercontent.com, which is not authorized to be used in the project with project_number: XXXXX. ]
at com.google.android.gms.internal.zzago.zzew(Unknown Source)
at com.google.android.gms.internal.zzagl$zzg.zza(Unknown Source)
at com.google.android.gms.internal.zzagw.zzex(Unknown Source)
at com.google.android.gms.internal.zzagw$zza.onFailure(Unknown Source)
at com.google.android.gms.internal.zzagr$zza.onTransact(Unknown Source)
at android.os.Binder.execTransact(Binder.java:453)
Run Code Online (Sandbox Code Playgroud)
(我将项目信息更改为XXXX)
Firebase配置可能会发生什么变化?请帮忙!
编辑:已解决,如下所述。您还需要在https://console.developers.google.com/apis/credentials上查看Google API控制台。
android google-authentication firebase firebase-authentication