【发布时间】:2019-10-29 10:35:45
【问题描述】:
我正在编写一个简单的逻辑来使用 Google Photos REST API 列出图片。一旦他们登录到我的应用程序,我想打印连接的用户个人资料。 但是我无法在 REST API 中找到任何端点来获取 Gmail 或 Drive REST API 中的用户配置文件。
https://developers.google.com/photos/library/guides/get-started#request-id
同时,我尝试从 oAuth2 访问令牌中获取用户详细信息,但它没有提供任何用户详细信息,例如邮件 ID 或名称。
获取 https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=ACCESS_TOKEN
回应:
{
"issued_to": "xxxxx.apps.googleusercontent.com",
"audience": "xxxxxx.apps.googleusercontent.com",
"scope": "https://www.googleapis.com/auth/photoslibrary",
"expires_in": 3522,
"access_type": "offline"
}
有没有办法从上面的oAuth2 access_token(独立于范围)中检索用户配置文件?
【问题讨论】:
标签: google-drive-api google-oauth google-photos-api