Firebase google auth 不允许我选择要连接的帐户

Jer*_*lam 6 google-authentication firebase firebase-authentication

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

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

this.googleProvider = new firebase.auth.GoogleAuthProvider();
this.googleProvider.setCustomParameters({
   prompt: "select_account",
});
Run Code Online (Sandbox Code Playgroud)

更多信息请参见:https://developers.google.com/identity/protocols/oauth2/openid-connect#authenticationuriparameters

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

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

Jer*_*lam 2

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

  • 所以我第一次登录时允许我打字。我的电子邮件地址并登录我的帐户。然后我退出,如何选择登录另一个帐户?现在它只是让我重新登录到第一个帐户。 (2认同)