[英]Error: Google id_token is not allowed to be used with this application. Firebase access fails after it was working
我正在使用 Google SignIn,然后使用signInWithCredential
在 Firebase 上進行身份驗證,傳遞 Google 憑據。
我遵循了所有程序,一切正常! 突然它停止工作。 我去了以前的工作代碼,但仍然失敗。 因此,數據庫配置似乎發生了一些事情。
在 Firebase 數據庫中,我已經檢查過:
谷歌登錄完成后,錯誤信息如下,我在監聽器中使用 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)
(我將我的項目信息更改為 XXXX)
Firebase 配置中還有哪些其他變化? 請幫忙!
編輯:解決,如下所述。 您還需要在https://console.developers.google.com/apis/credentials查看 Google API 控制台
聽起來您的登錄方法已更改。 您需要進入 firebase 身份驗證頁面並確保仍然允許 google 登錄。
轉到 Firebase 控制台 -> 身份驗證 -> 登錄方法並在登錄提供程序中確保啟用了 Google。
此外,你可以這樣做:
獲取您的 Web 客戶端 ID 並記下客戶端 ID 和機密。
將此客戶端 ID 輸入到您的 Firebase 項目的配置中:
轉到位於https://console.firebase.google.com的 Firebase 控制台 打開身份驗證部分 在登錄方法下,打開 Google 配置,然后在 Web SDK 配置部分下添加值。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.