Google帐户:可以从openid检索图片吗?我可以通过 OAuth 获取它吗?
我需要从 Google 帐户检索姓名、电子邮件和图片。
我已经在使用 openid 来让用户使用 google acc 登录。
我可以从 openid 进程中获得图片 URL 吗?
使用 OAuth 我似乎无法找到检索此信息的正确范围...请参阅此链接:
http://code.google.com/apis/gdata/docs/directory.html
有一个范围列表,您可以使用 REST api 获取到 google,但我没有看到与配置文件相关的范围。
顺便说一句,我正在使用 PHP,openid 已经可以工作,但直到我知道我是否可以(并且需要)检索图片时才开始使用 oauth(因为电子邮件和姓名已经包含在 openid 进程中)
谢谢,
乔
I need to retrieve the name, email and picture from a google account.
I am already using the openid to make the user login with it's google acc.
Can I have the picture URL from the openid proccess?
with OAuth I cant'seem to find the right scope to retrieve this information... See this link:
http://code.google.com/apis/gdata/docs/directory.html
there is a list of scopes that you can fetch with REST api to google and I didnt't see the one related to the profile.
Btw, I am using PHP and the openid is already working, but didn't start with the oauth untill I know if I can(and need) retrieve the picture (because email and name already comes within the openid proccess)
thanks,
Joe
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来您可以使用 Google Contacts Data API 检索图片网址:请参阅 http://code.google.com/intl/fr/apis/contacts/docs/3.0/developers_guide_protocol.html#retriving_photo
然后,您必须使用 OAuth 验证您的请求。如果您已使用 OpenID,现在可以使用混合协议 OpenId/OAuth :请参阅 http://code.google.com/intl/fr/apis/accounts/docs/OpenID.html#oauth
It seems that you can retrieve the picture URL with the Google Contacts Data API : see http://code.google.com/intl/fr/apis/contacts/docs/3.0/developers_guide_protocol.html#retrieving_photo
Then you must authenticate your requests with OAuth. If you already use OpenID, you can now use the hybid protocol OpenId/OAuth : see http://code.google.com/intl/fr/apis/accounts/docs/OpenID.html#oauth