【问题标题】:Google API not returning name and people scope is invalidGoogle API 未返回名称和人员范围无效
【发布时间】:2014-07-09 06:45:26
【问题描述】:

我正在使用 OAuth2.0 连接到 Google 并尝试获取用户详细信息。我正在获取电子邮件 ID 等。但我无法从我收到的 access_token 中获取名称和其他数据。

目前我正在使用scopes - 'https://www.googleapis.com/auth/plus.me','email'

我知道有一个作用域https://www.googleapis.com/plus/v1/people/me,但是当我使用它时,我得到了无效作用域错误。但是,我手动访问https://www.googleapis.com/plus/v1/people/me?access_token=# 然后它工作得很好。但是通过API它不起作用:(

有什么线索吗?

我正在使用 PHP 的 Google Api 将 $client 实例化为 new Google_Client();

【问题讨论】:

    标签: php oauth-2.0 google-api google-oauth google-api-php-client


    【解决方案1】:

    使用profileemail 作为作用域,https://www.googleapis.com/plus/v1/people/me 不是作用域,它是一个 API。

    For your reference.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-10-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-20
      • 2013-08-24
      • 2016-09-14
      相关资源
      最近更新 更多