【问题标题】:google oauth prefill account emailgoogle oauth 预填充帐户电子邮件
【发布时间】:2023-03-09 11:16:01
【问题描述】:

使用 google api 的 oauth 服务时如何预填账号。它要求我输入电子邮件地址。我安装了其他已为我选择了 gmail 帐户的扩展程序。这是我启动它时的样子:

        var opts = {
            interactive: true,
            url: `https://accounts.google.com/o/oauth2/v2/auth?client_id=${clientId}&scope=${scopeParam}&redirect_uri=${redirectUrl}&response_type=token`
        };

chrome.identity.launchWebAuthFlow(opts, authUrl => {...});

【问题讨论】:

    标签: google-api google-oauth


    【解决方案1】:

    查看documentationlogin_hint 是您所追求的身份验证 URI 参数。所以你的url 可能看起来像这样:

    https://accounts.google.com/o/oauth2/v2/auth?client_id=${clientId}&scope=${scopeParam}&redirect_uri=${redirectUrl}&response_type=token&login_hint=chris@gmail.com

    请记住,Google 不会预先填充虚假的 gmail 地址 - 您需要使用真实的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-22
      • 2012-11-22
      • 1970-01-01
      • 2023-03-07
      • 1970-01-01
      • 1970-01-01
      • 2014-06-17
      • 2011-06-24
      相关资源
      最近更新 更多