mohan mohan - 4 months ago 16
Node.js Question

nodeJs: how to disable google account chooser and pass only one mail id

This link redirects to account chooser, but I dont wanna choose any one account. In nodejs I need to disable account chooser, Is it possible to disable in nodejs and pass email in the url itself but not redirect to account chooser. (By default I wanna send any one id(example@gmail.com) along with the url)

This URL is used to produce 'code' value using that code value the access token for specified user will be get. I am doing it by systematically to get the code and proceed with getting the access token. For each time I am generating the URL its redirecting me to account chooser. Instead of that I wanna send my email id along with the URL, so that I no need to manually select the account to get the code and proceed with it.

URL: https://accounts.google.com/o/oauth2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.me%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.login%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.profiles.read%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffitness.activity.read%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffitness.body.read%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffitness.body.write&response_type=code&client_id=********************************&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fauth%2Fgoogle%2Freturn

Answer
Try this:
login_hint=emailid

URL + &login_hint=emailid. It will work fine

URL: https://accounts.google.com/o/oauth2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.me%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.login%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.profiles.read%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffitness.activity.read%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffitness.body.read%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffitness.body.write&response_type=code&client_id=********************************&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fauth%2Fgoogle%2Freturn