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

Is login hint available under the new Google Identity Services library? #837

Open
filmerjarred opened this issue Nov 9, 2022 · 1 comment

Comments

@filmerjarred
Copy link

Sorry for posting an issue here, but I couldn't find any repo for the new library.

I'm making an app that connects to a google calender.
I would like make the sign-up and connecting to calender flow as seamless as possible.
My understanding is that this can be done with "login hints":

From the docs at https://developers.google.com/identity/oauth2/web/guides/how-user-authz-works

Adding a hint during authorization initialization--typically the email address of the user's Google Account--enables Google to skip the display of an account chooser, saving users a step. The ID Token credential returned by Sign In With Google contains the user's email address.

From past issues and digging around in the source, it looks I can run the "sign in with google" flow, and then pass an email from that to the authorisation flow like so:

image

This does redirect to a link with "login_hint=EMAIL_FROM_LOGIN_FLOW", but still displays the account selection.

Am I doing something wrong, or is this feature not yet supported in the new library?

Much thanks,

Jarred

@rhashimoto
Copy link

Your code sample uses a "hint" property, though the documentation specifies the property name as "login_hint". Nevertheless, it sounds like you're still getting the proper URL param so that's apparently not the problem.

I have tried to bypass the account chooser by setting login_hint to both the user email and the id token sub field. Neither seems to work; I still get the account chooser as you do. I tried both the "popup" and "redirect" ux modes.

I can avoid the account chooser if I use OAuth2Client.generateAuthUrl() on the server side with a login_hint. So that works but isn't ideal because it only supports the redirect flow.

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

2 participants