【发布时间】:2021-12-23 22:34:46
【问题描述】:
您好,我正在开发 google oauth2 登录,但我不知道如何使用 access 令牌或 id 令牌使用此 url 获取用户信息
- https://www.googleapis.com/oauth2/v3/userinfo 在 Authorization 标头中传递访问令牌会返回此 json:
"sub": "100366573866312827626",
"picture": "https://lh3.googleusercontent.com/a/default-user=s96-c"
}
{
"iss": "https://accounts.google.com",
"azp": "375890336523-u4rpach5688ltoc0v4mof1r7j70gem95.apps.googleusercontent.com",
"aud": "375890336523-u4rpach5688ltoc0v4mof1r7j70gem95.apps.googleusercontent.com",
"sub": "100366573866312827626",
"at_hash": "htkn2tQqV4Ff4EmrtPDh9w",
"iat": "1636631006",
"exp": "1636634606",
"alg": "RS256",
"kid": "27c72619d0935a290c41c3f010167138685f7e53",
"typ": "JWT"
}
但在这两个 json 中都没有任何用户信息,如用户名或电子邮件
感谢您的宝贵时间,抱歉我的英语不是我的母语
【问题讨论】:
标签: json rest oauth-2.0 google-oauth access-token