Ari*_*rez 5 android google-authentication firebase firebase-authentication
我正在使用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控制台。
小智 5
听起来您的登录方法已更改。您需要进入 firebase 身份验证页面并确保仍然允许 google 登录。
\n\n转到 Firebase 控制台 -> 身份验证 -> 登录方法 \n 并在登录提供程序中确保启用 Google。
\n\n另外,你还可以这样做:
\n\n获取您的 Web 客户端 ID 并记下客户端 ID 和密码。
\n\n将此客户端 ID 输入到您的 Firebase 项目\xe2\x80\x99s 配置中:
\n\n转到 Firebase 控制台:https://console.firebase.google.com \n打开身份验证部分\n在登录方法下,打开 Google 配置,然后在 Web SDK 配置部分下添加值。
\n| 归档时间: |
|
| 查看次数: |
4650 次 |
| 最近记录: |