【问题标题】:Debugging a firebase auth app from vscode and chrome not working从 vscode 和 chrome 调试 firebase auth 应用程序不起作用
【发布时间】:2020-02-05 20:41:55
【问题描述】:

我有一个使用 Firebase 身份验证和谷歌登录提供程序的网络应用程序(角度)。在 Windows 上,当我在调试模式下使用 vscode 附加到 chrome 到在 localhost:4200 上运行的应用程序时,当我在输入我的谷歌凭据后尝试在弹出窗口中使用谷歌帐户登录时,我收到以下消息:

Couldn't sign you in
This browser or app may not be secure.
Try using a different browser. If you’re already using a supported browser, you can refresh your screen and try again to sign in.

如果我没有在调试模式下使用 vscode 启动 chrome,而只是从开始菜单启动 chrome 并将其指向 localhost:4200,则该应用程序可以运行并成功登录。此外,以这种方式启动时,我可以在网站上成功使用内置的 chrome 调试器。

我在基于铬的新边缘上也遇到了同样的问题;但没有在旧的边缘得到它。

我想知道chrome中是否有一些安全设置需要调整?还是 gcp/google 身份验证设置。

来自 vscode 的launch.json 供参考:

 {
      "type": "chrome",
      "request": "launch",
      "name": "Launch Chrome against localhost:4200 for pitch evaluator",
      "url": "http://localhost:4200",
      "webRoot": "${workspaceFolder}/apps/pitch-evaluator"
    },

这曾经有效;所以我不知道发生了什么变化;但怀疑 google 和 chromium 安全性发生了一些变化。

【问题讨论】:

  • 您是否偶然找到了解决方案?我现在面临同样的事情:/

标签: google-chrome visual-studio-code firebase-authentication


【解决方案1】:

来自link....

    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:3000",
            "webRoot": "${workspaceFolder}",
            "userDataDir": false    // <----- Note this line
        }
    ]

注意:确保关闭所有 Chrome 实例

【讨论】:

  • 这很奇怪;当我用全新的 chrome 设置另一台电脑时,最初的问题随机消失了。这里的答案很有用;但实际上回答了一个不同的问题。这可以让配置文件从您的“生产”chrome 版本重新用于调试;在我的问题中;在调试器下使用 google auth 导致 google auth 失败。无论如何,感谢您提供帮助。
  • 这个答案对我有用。 (重新安装新的谷歌浏览器对我不起作用)
猜你喜欢
  • 2016-08-28
  • 1970-01-01
  • 1970-01-01
  • 2018-05-13
  • 1970-01-01
  • 2020-10-17
  • 2017-03-16
  • 1970-01-01
  • 2018-09-05
相关资源
最近更新 更多