【问题标题】:getting a google id and an access token from a google username/password从 google 用户名/密码获取 google id 和访问令牌
【发布时间】:2013-04-26 22:16:11
【问题描述】:

我正在创建一个无头服务,我打算使用它来访问第三方 API。为此,我需要使用谷歌访问令牌通过第三方 API 授权自己。因为我希望这项服务以无头方式运行(即没有用户输入),所以我在 Google 创建了一个特殊帐户,现在我想使用 OAuth 获取访问令牌和 google id - 需要注意的是这是一项无头服务,所以我需要在没有“用户”输入用户名/密码的情况下执行此操作。

我该怎么做?

【问题讨论】:

  • 我想知道是否可以使用浏览器获取访问令牌,但要确保它永不过期......

标签: oauth oauth-2.0 google-oauth


【解决方案1】:

关于您的评论,您可以通过网络流程获取刷新令牌。刷新令牌永不过期(尽管用户可以撤销它们),并且可用于根据需要经常获取访问令牌。请参阅https://developers.google.com/accounts/docs/OAuth2WebServer 了解更多信息。

【讨论】:

    猜你喜欢
    • 2011-09-04
    • 1970-01-01
    • 1970-01-01
    • 2012-04-28
    • 1970-01-01
    • 1970-01-01
    • 2023-03-27
    • 1970-01-01
    • 2015-02-24
    相关资源
    最近更新 更多