abacritt / angularx-social-login

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

GetAccessToken prompting sign in pop up again #757

Open Azeem709 opened 8 months ago

Azeem709 commented 8 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 7 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 7 months ago

I have this problem as well

jerry153fish commented 7 months ago

Same here.

Vivekcholaraju commented 6 months ago

same here

frmanmartiono commented 6 months ago

Any solution for this issue?

Venom1991 commented 5 months 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.