Google API REST 调用仅返回用户 ID 和图片。如何获取更多用户信息?

问题描述 投票:0回答:0

我尝试通过 API 请求访问 Google 用户信息;

 https://www.googleapis.com/oauth2/v1/userinfo?access_token=ya29.a0Ael9sCMYNzgxZT27Cb....

我得到的回复是身份证和个人资料照片:

{
    "id": "1.....",
    "picture": "https://lh3.googleusercontent.com/a-/ACB-R5Sg...."
}

我需要更多用户信息:电子邮件、姓名等

我在开发人员控制台中添加了 user.profile 和 userinfo.email 以及 userinfo.profile 范围。

我知道添加的范围可能需要 5 分钟到几个小时才能工作,但我在 ~12 小时前添加了它。

如何修复我的 API REST 调用以从 Google API 获取更多用户信息?

api rest google-api google-oauth access-token
© www.soinside.com 2019 - 2024. All rights reserved.