abacritt / angularx-social-login

Social login and authentication module for Angular 17
629 stars 388 forks source link

GetAccessToken prompting sign in pop up again #757

Open Azeem709 opened 3 months ago

Azeem709 commented 3 months ago

I'm trying to integrate sign in with gmail in angular 16 app, and able to get the userInfo using this.authService.authState.subscribe((user) => { this.user = user; this.loggedIn = (user != null); }); but I need accessToken to pass to resource server and login pop up is prompting again if i try to retrieve access token using getAccessToken(): void { this.authService.getAccessToken(GoogleLoginProvider.PROVIDER_ID).then(accessToken => this.accessToken = accessToken); } Is there a way i can retrieve accessToken without 2 prompts for id token and access tokoen

ddenton12 commented 3 months ago

I am seeing the same issue -- it is essentially forcing the user to sign in twice. I am unable to invoke getAccessToken() without first subscribing to the authState change, which only occurs when I click the Google sign in button or one-tap. Is this intended behavior?

rhyous commented 2 months ago

I have this problem as well

jerry153fish commented 2 months ago

Same here.

Vivekcholaraju commented 2 months ago

same here

frmanmartiono commented 1 month ago

Any solution for this issue?

Venom1991 commented 1 month ago

Same here, Angular 17.

Quote from the docs:

Each call to requestAccessToken triggers a user consent moment, your app will have access only to those resources required by the section a user chooses to expand, thus limiting resource sharing through user choice.