【问题标题】:Firebase google auth won't let me choose the account to connect withFirebase google auth 不允许我选择要连接的帐户
【发布时间】:2020-05-27 12:29:34
【问题描述】:

我在我的应用中实施了 Firebase 身份验证,让我的用户可以连接到他们的 Google 帐户。到目前为止一切顺利,但是一旦用户从 google 帐户选择器弹出窗口中选择连接特定帐户,他将无法在下次登录时选择其他帐户。之前选择的帐户将被自动选择用于身份验证。

我真的不认为这种行为是正确的,所以我正在尝试修复它。 经过一番研究,我发现我可以将setCustomParameters(prompt: "select_account")googleProvider 一起使用,如下所示:

this.googleProvider = new firebase.auth.GoogleAuthProvider();
this.googleProvider.setCustomParameters({
   prompt: "select_account",
});

更多信息在这里:https://developers.google.com/identity/protocols/oauth2/openid-connect#authenticationuriparameters

就我而言,使用consentselect_account 参数似乎没有任何影响,用户无法选择要使用的帐户。

编辑:它似乎可以在 chrome 上正常工作,但不能在 firefox 上工作......

【问题讨论】:

    标签: firebase firebase-authentication google-authentication


    【解决方案1】:

    我已经找到了问题的根源,实际上这并不是真正的问题。仅当您在当前使用的设备/浏览器上注册了其他帐户时,才会显示 Google 帐户选择器。如果您想选择一个未保存到您的设备/浏览器中的其他帐户,您首先需要通过 google 登录。

    【讨论】:

      猜你喜欢
      • 2015-12-08
      • 2016-12-26
      • 1970-01-01
      • 1970-01-01
      • 2018-07-14
      • 2012-11-07
      • 1970-01-01
      • 1970-01-01
      • 2020-05-27
      相关资源
      最近更新 更多