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
就我而言,使用consent和select_account参数似乎没有任何影响,用户无法选择要使用哪个帐户。
编辑:它似乎可以在 chrome 上正常工作,但在 firefox 上却不能...
我已经找到了问题的根源,事实上这并不是一个真正的问题。仅当您在当前使用的设备/浏览器上注册了其他帐户时,Google 帐户选择器才会显示。如果您想选择未保存到您的设备/浏览器中的其他帐户,您首先需要通过谷歌登录。
| 归档时间: |
|
| 查看次数: |
2019 次 |
| 最近记录: |