随着 Google+ 被关闭,OAuth API 是否也消失了?

With Google+ being shutdown, is the OAuth API gone too?

我们的许多用户通过 Google OAuth API (https://developers.google.com/+/web/api/rest/oauth)

进行身份验证

Google 的 OAuth API 版本在 2019 年 4 月之后的未来是什么?

OAuth 之外,我们使用以下端点获取用户的电子邮件和姓名:https://www.googleapis.com/plus/v1/people/me 一旦我们获得了访问令牌。这个端点会过时吗?

18 年 12 月 21 日更新

Google+ Shutdown Notice

[结束更新]

OAuth 2.0 是由 Google 帐户提供的一项服务。 Google+ 的生命周期结束不会影响 OAuth 2.0。

OAuth 2.0 是 Google Cloud Platform、G Suite 和许多其他服务的基础身份验证服务。 OAuth 2.0 基于令牌,这些令牌可用于各种服务,包括基于 Google 和第三方的服务。

下面关于端点的评论部分提出了一个进一步的问题。

用户信息的 Google+ 端点:googleapis.com/plus/v1/people/me 可能会继续存在多年(等待 Google 的官方公告)。

我将开始使用 Google OAuth 2.0 端点(注意 alt=json):https://www.googleapis.com/oauth2/v3/userinfo?alt=json

其中 returns Json 看起来像这样:

{
  "id": "123456789012345678901",
  "email": "username@example.com",
  "verified_email": true,
  "name": "User Name",
  "given_name": "User",
  "family_name": "Name",
  "link": "https://plus.google.com/123456789012345678901",
  "picture": "https://lh3.googleusercontent.com/.../mo/photo.jpg",
  "locale": "en",
  "hd": "example.com"
}

当前 Google 个 OAuth 2.0 端点列表:

https://accounts.google.com/.well-known/openid-configuration

What is the future of OAuth API beyond the April 2019?

Oauth 不是 api 它是一种身份验证协议。在这种情况下,身份验证响应用于访问 googles APIs。 Googles 使用 Oauth2 进行身份验证在没有以任何方式终止的公告中没有任何意义。我也不认为他们会据我所知这是目前用于验证 APIs

的行业标准

OAuth aside, we use the following endpoint to obtain the user's email and name: https://www.googleapis.com/plus/v1/people/me once we obtain the access token. Is this endpoint

Google 人 api 可能在 url 中包含术语 plus 但它与 Google plus 没有任何关系(除了非常糟糕命名)。

[文档] People api lets you list and manage the authenticated user's Contacts 并检索经过身份验证的用户及其联系人的配置文件信息。

这实际上与 Google plus 无关,只是一些用户个人资料信息可能最初包含在 Google plus 中,我怀疑现在已被移动(但我没有证明)。 我确实向 google 发送了一封电子邮件,要求澄清哪些端点正在关闭。

关机

那么关机会发生什么

people overview 会发生什么将是一个很好的问题。他们可能会被重命名,但我怀疑他们可能只是单独留下来访问 google 联系人,就像他们目前所做的那样。 (同样,我对此一无所知)

获取当前用户信息

如果您想获取有关当前用户的信息,那么一个想法是使用 userinfo 端点。只要您请求配置文件范围,您就可以直接从身份服务器请求当前用户信息

要求:

GET /oauth2/v2/userinfo HTTP/1.1
Host: www.googleapis.com
Content-length: 0
Authorization: Bearer qMgWQHD0MstTDVip7hIYipUpSQkxexF4-W0bI3geEaYk0ztVryYZyFRrZDFWkn69Hw3RlBjfOuXJ8df_iv5ATgW3y0BUkI0xMXeGq22qmfqG-4duSU

回复:

{
  "picture": "https://lh5.googleusercontent.com/-a1CWlFnA5xE/AAAAAAAAAAI/AAAAAAAAl1I/UcwPajZOuN4/photo.jpg", 
  "name": "Linda Lawton", 
  "family_name": "Lawton", 
  "locale": "en", 
  "gender": "female", 
  "link": "https://plus.google.com/+LindaLawton", 
  "given_name": "Linda", 
  "id": "117200475532672775346"
}

我怀疑其中一些情况会发生变化。例如,Link 将无法再从 link 到 google 加。我想我会向 google 发送一封电子邮件,看看他们打算如何处理。

如果您在验证用户时还请求了电子邮件范围,则电子邮件只会出现在响应中。

更新

关于 api 关机的博客 post 刚刚停止运行,并提供有关 API 正在关闭的内容和时间的信息。

The most commonly used APIs that are being shut down include:

  • Google+ REST API

  • Google+ Web API

  • Google+ Android SDK

  • Google+ Domains API

  • Google+ Pages API

这仍然没有解决 API 作为 Google 联系人但属于 Google+ 其余部分 API

的问题

https://developers.googleblog.com/2018/12/google-apis-shutting-down-march-7-2019.html?m=1

要从您的应用中禁用此 Google + API,您需要转到 https://console.developers.google.com

... 并导航至您正在使用的每个项目 Google+ Api 并单击 DISABLE

这将删除来自 Google + API 的所有请求。