使用Google OAuth API检索出生日期 [英] Retrieving date of birth with Google OAuth API
问题描述
有没有人知道如何通过Google OAuth API回复D.O.B?通过将范围设置为 https://www.googleapis.com/,我可以获取姓名,电子邮件,性别等其他信息AUTH / userinfo.profile 。但我无法使用此范围获得DOB。
Does any one know how to retrive D.O.B through Google OAuth api? I am able to get other information like name, email, gender by setting the scope as https://www.googleapis.com/auth/userinfo.profile. But I am not able to get D.O.B with this scope.
推荐答案
我的帐户绝对可以获得:
I definitely get it for my account:
{
"id": "108635752367054807758",
"name": "Nicolas Garnier",
"given_name": "Nicolas",
"family_name": "Garnier",
"link": "https://plus.google.com/108635752367054807758",
"picture": "https://lh4.googleusercontent.com/-K1xGP8W20xk/AAAAAAAAAAI/AAAAAAAABhY/Cs_4qr30MxI/photo.jpg",
"gender": "male",
"birthday": "0000-08-25",
"locale": "en"
}
我所做的一切授权 https://www.googleapis.com/auth/userinfo.profile 范围,然后向 https://www.googleapis.com/oauth2/v2/userinfo发送GET请求
all I did is authorize for the https://www.googleapis.com/auth/userinfo.profile scope and then sent a GET request to https://www.googleapis.com/oauth2/v2/userinfo
首先确保您正在测试的Google+帐户已设置生日(当然),然后在OAuth 2.0 Playground上尝试请求,例如: https://code.google.com/oauthplayground/#step1& ; apisSelect = https%3A // www.googleapis.com / auth / userinfo.profile& url = https%3A // www.googleapis.com / oauth2 / v2 / userinfo
First make sure that the Google+ account that you are testing with has set a Birthday (of course), then try the request on the OAuth 2.0 Playground for instance: https://code.google.com/oauthplayground/#step1&apisSelect=https%3A//www.googleapis.com/auth/userinfo.profile&url=https%3A//www.googleapis.com/oauth2/v2/userinfo
这篇关于使用Google OAuth API检索出生日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!