首页 > 解决方案 > 随着 Google+ 被关闭,OAuth API 是否也消失了?

问题描述

我们的一些用户通过 Google OAuth API ( https://developers.google.com/+/web/api/rest/oauth )进行身份验证

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

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

标签: oauthgoogle-apigoogle-plusgoogle-oauth

解决方案


2018 年 12 月 21 日更新

Google+ 关闭通知

[结束更新]

OAuth 2.0 是 Google Accounts 提供的一项服务。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

返回的 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


推荐阅读