Google plus Google Plus userProfile API在尝试使用使用Google服务帐户检索的访问令牌进行访问时返回错误
我可以使用Google服务帐户检索访问令牌,但当我尝试使用相同的访问令牌检索Google Plus用户配置文件API时,我遇到了以下错误: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:
{
"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
范围。有关更多详细信息,请参阅