Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetAccessToken prompting sign in pop up again #757

Open
Azeem709 opened this issue Mar 10, 2024 · 10 comments
Open

GetAccessToken prompting sign in pop up again #757

Azeem709 opened this issue Mar 10, 2024 · 10 comments

Comments

@Azeem709
Copy link

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
Copy link

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
Copy link

rhyous commented Apr 12, 2024

I have this problem as well

@jerry153fish
Copy link

Same here.

@Vivekcholaraju
Copy link

same here

@frmanmartiono
Copy link

Any solution for this issue?

@Venom1991
Copy link

Venom1991 commented May 29, 2024

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.

@nick-jonas
Copy link

Same, Angular 18. So there's no way around making this a smoother experience?

@Venom1991
Copy link

Same, Angular 18. So there's no way around making this a smoother experience?

I've solved my problem by moving to this library. It works great.
I still use this library for Facebook login needs, though.

@nick-jonas
Copy link

Same, Angular 18. So there's no way around making this a smoother experience?

I've solved my problem by moving to this library. It works great. I still use this library for Facebook login needs, though.

how do you enable automatic login with it though?

@Venom1991
Copy link

Venom1991 commented Nov 27, 2024

how do you enable automatic login with it though?

I don't really know because I didn't need that feature. It should be possible, at least judging by the last bullet point in this list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants