I'm able to login, log out and "Remove account" with Gmail in standalone Chrome same as ordinary non-developer end users.
Start a skeleton Angular project in VSC using angularx-social-login, encounter the following two issues with login.
Issue 1) F5 with typical launch setting, after username and password got a message below (regardless logoutWithGoogle is triggered.)
{
"type": "pwa-chrome",
"request": "launch",
"name": "F5 against localhost",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}"
}
Couldn't sign you in This browser or app may not be secure Try using a different browser. ...
Issue 2) Using attach process for debugging, it bypasses username/password and let me in after following screen shows briefly (regardless logoutWithGoogle is triggered)
{
"name": "Attach to a running Chrome @4200",
"type": "pwa-chrome",
"request": "attach",
"port": 9222,
"urlFilter": "http://localhost:4200/*",
"webRoot": "${workspaceFolder}"
},
app.modules.ts
import { GoogleLoginProvider, SocialAuthServiceConfig, SocialLoginModule } from 'angularx-social-login';
@ngModule({ ...
providers: [ {provide: 'SocialAuthServiceConfig', useValue:{autoLogin: false, providers: [{id: GoogleLoginProvider.PROVIDER_ID, provider: new GoogleLoginProvider('my Google-Client-ID')}]} as SocialAuthServiceConfig,}, ]
app.component.ts
import { SocialAuthService, GoogleLoginProvider, SocialUser } from 'angularx-social-login';
...
constructor(private socialAuthService: SocialAuthService) {}
ngOnInit()
{
this.socialAuthService.authState.subscribe
(
user =>
{
this.socialUser = user;
this.isLoggedin = (user != null);
console.log(this.socialUser);
},
bad =>
{
console.log(bad);
}
);
}
loginWithGoogle(): void { this.socialAuthService.signIn(GoogleLoginProvider.PROVIDER_ID);}
logoutWithGoogle(): void { this.isLoggedin = false; this.socialAuthService.signOut(); }
Since standalone Chrome works perfectly, it should be related to Angular package or VSC. Here are the versions listed in cmd window:
[email protected]
Angular CLI: 11.2.6
Node: 14.9.0
OS: win32 x64
Angular: 11.2.7
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1102.6
@angular-devkit/build-angular 0.1102.6
@angular-devkit/core 11.2.6
@angular-devkit/schematics 11.2.6
@angular/cli 11.2.6
@schematics/angular 11.2.6
@schematics/update 0.1102.6
rxjs 6.6.6
typescript 4.0.7
VSC About:
Version: 1.56.2 (user setup)
Commit: 054a9295330880ed74ceaedda236253b4f39a335
Date: 2021-05-12T17:13:13.157Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Windows_NT x64 10.0.19041


The solution for F5 debugging is to change settings of launch.json:
"chrome"instead ofpwa-chromefortype.Following is mine: