Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google plus Google Plus userProfile API在尝试使用使用Google服务帐户检索的访问令牌进行访问时返回错误_Google Plus_Service Accounts - Fatal编程技术网

Google plus Google Plus userProfile API在尝试使用使用Google服务帐户检索的访问令牌进行访问时返回错误

Google plus Google Plus userProfile API在尝试使用使用Google服务帐户检索的访问令牌进行访问时返回错误,google-plus,service-accounts,Google Plus,Service Accounts,我可以使用Google服务帐户检索访问令牌,但当我尝试使用相同的访问令牌检索Google Plus用户配置文件API时,我遇到了以下错误: { "error": { "errors": [ { "domain": "global", "reason": "notFound", "message": "Not Found" } ], "code": 404, "message": "Not Found" } } 我使用范围值作为https:

我可以使用Google服务帐户检索访问令牌,但当我尝试使用相同的访问令牌检索Google Plus用户配置文件API时,我遇到了以下错误:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "notFound",
    "message": "Not Found"
   }
  ],
  "code": 404,
  "message": "Not Found"
 }
}
我使用范围值作为
https://www.googleapis.com/auth/plus.me
在使用Google服务帐户检索访问令牌时,我能够获取访问令牌,但如果我尝试使用相同的访问令牌请求用户配置文件API,即
https://www.googleapis.com/plus/v1/people/me?prettyprint=true
我得到了上面的错误


有人能帮我吗?

这很可能是因为进行身份验证的帐户没有Google+帐户/个人资料。对于测试,您可能希望将“me”替换为有问题的配置文件ID,以验证这一点。当然,在生产过程中,您应该捕获此错误并指出他们没有Google+配置文件

如果您需要检查Google登录,即使他们没有Google+个人资料,您也可以使用
https://www.googleapis.com/auth/userinfo.profile
范围。有关更多详细信息,请参阅