Lightopenid 和 yahoo 用户电子邮件
雅虎的 openid 支持目前状况如何?无论我如何尝试,它都只返回 nameperson 属性,但我无法获取用户的电子邮件(联系人/电子邮件)。有没有办法通过 lightopenid 库获取电子邮件?
What's the current state of Yahoo's openid support? No matter how I tried, it only gives back the nameperson attribute, but I can't get the user's email (contact/email). Is there any way to get the email with the lightopenid library?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正是按照您尝试的方式 - 将
'contact/email'
添加到$openid->required
(或可选
)。如果提供商没有回复电子邮件——那也没关系,但也没有必要。这并不意味着提供商不支持 OpenID,或者不支持 SREG/AX(用于获取电子邮件的 OpenID 扩展)。这只是意味着它决定不向您发送电子邮件地址。
所以我的建议是:停止依赖于此。
OpenID 是一种去中心化协议,因此有很多提供商不会返回电子邮件和其他数据,但您仍然必须支持他们。再说一次:提供者可能会返回它想要的任何数据,无论您要求什么,因此您不能依赖它被返回。
Exactly the way you tried -- by adding
'contact/email'
to$openid->required
(oroptional
).If a provider doesn't return the email -- that's fine, it doesn't have to. It doesn't mean that the provider doesn't support OpenID, or doesn't support SREG/AX (the OpenID extensions used to fetch the email). It just means that it decided not to send you the email address.
So my advice is: stop depending on that.
OpenID is a decentralized protocol, so there are a lot of providers that won't return email and other data, and you still have to support them. So again: the provider may return whatever data it wants, regardless of what you asked for, so you can't depend on it being returned.