toddwseattle
toddwseattle

Reputation: 733

Debugging a firebase auth app from vscode and chrome not working

I have a web app (angular) that uses firebase authentication with the google login provider. On windows, when I use vscode attaching to chrome in debug mode to the app running on localhost:4200, I get the following message when I attempt to login with a google account in the popup after entering my google credentials:

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.

The app works and logs in successfully if I don't have vscode launch chrome in debug mode but instead just launch chrome from the start menu and point it at localhost:4200. Additionally, I can successfully use the built in chrome debugger on the site when launched in this manner.

I get the same issue on the new edge based on chromium as well; but didn't get it on old edge.

I'm wondering if there is some security setting in chrome that needs to be adjusted? or is it a gcp/google auth setting.

launch.json from vscode for reference:

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

This used to work; so I can't figure out what changed; but suspect some change in google and chromium security.

Upvotes: 7

Views: 2158

Answers (2)

ShinobiWPS
ShinobiWPS

Reputation: 11

As of January 2024, this issue still persist for many and this is the position of Google Google instructions offering OAuth authentication or migrate to a PWA

So we should migrate to a PWA or use browser OAuth authentication. Consider also that "Less secure apps" option is gonna be disabled soon (Fall 2024). Here both links mentioned in the screenshot:

  1. https://developers.google.com/identity/protocols/OAuth2InstalledApp
  2. https://developers.google.com/web/progressive-web-apps/

Upvotes: 0

Musa Biralo
Musa Biralo

Reputation: 529

From this 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
        }
    ]

Note: Make sure to close all Chrome instances

Upvotes: 10

Related Questions