首页 > 解决方案 > “错误:给定的登录提供程序已为 Firebase 项目禁用。” 但我启用了 firebase google auth

问题描述

错误

Firebase 控制台

我正在将 ionic 3 用于 android 应用程序,但在谷歌加上使用 firebase 登录时出错。集成 ionic 和 cordova g+ 插件,我的代码是

gPlusLogin(){
    this.nativeGLogin();
}

async nativeGLogin(){
    try {
       const gplusUser = await this.googlePlus.login({
         'webClientId': '235*********ie.apps.googleusercontent.com',
         'offline': true
       })

       return await this.afAuth.auth.signInWithCredential(firebase.auth.GithubAuthProvider.credential(gplusUser.idToken))
     } catch (error) {
         this.errorAlert(error)
     }
}

标签: androidfirebaseionic-frameworkfirebase-authentication

解决方案


当您打算使用 Google 登录时,您正在使用GithubAuthProvider您的,这可能是问题所在。signInWithCredential


推荐阅读