此链接重定向到帐户选择器,但我不想选择任何一个帐户。在nodejs中,我需要禁用帐户选择器,是否可以在nodejs中禁用并在url本身中传递电子邮件,但不重定向到帐户选择器。 (默认情况下,我想发送任何一个 id(example@gmail.com) 以及 url)
此 URL 用于使用将获取指定用户的访问 token 的代码值来生成“代码”值。我正在系统地获取代码并继续获取访问 token 。每次我生成 URL 时,它都会将我重定向到帐户选择器。相反,我想将我的电子邮件 ID 与 URL 一起发送,这样我就无需手动选择帐户来获取代码并继续操作。
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
最佳答案
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
关于node.js - Node Js : how to disable google account chooser and pass only one mail id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35551581/