0

雅虎的 openid 支持现状如何?无论我如何尝试,它只返回nameperson属性,但我无法获取用户的电子邮件(联系人/电子邮件)。有什么方法可以通过 lightopenid 库获取电子邮件?

4

1 回答 1

0

Exactly the way you tried -- by adding 'contact/email' to $openid->required (or optional).

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.

于 2011-11-04T19:13:13.897 回答