如果您想要 token_info,请将 tokeninfo作为参数传递
https://www.googleapis.com/oauth2/v3/tokeninfo?access_token=ya29.a0AfH6SMArZZITzn-...
如果您想要所有用户信息,请将userinfo作为参数传递
https://www.googleapis.com/oauth2/v3/userinfo?access_token=ya29.a0AfH6SMArZZITzn-...
令牌信息响应
{
"azp": "",
"aud": "",
"sub": "",
"scope": "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile openid",
"exp": "",
"expires_in": "",
"email": "",
"email_verified": "",
"access_type": ""
}
用户信息响应
{
"sub": "",
"name": "",
"given_name": "",
"family_name": "",
"picture": "",
"email": "",
"email_verified": ,
"locale": ""
}
不要忘记传递https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile作为范围
var params = {
'client_id': '',
'redirect_uri': '',
'response_type': 'token',
'scope': 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile',
};