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

问题描述 投票:0回答:1

我已在我的应用程序中实现Firebase Auth,以使我的用户与他们的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个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.