OpenID的谷歌和雅虎实现是否尊重“;“必需”;属性


Do the Google and Yahoo implementations of OpenID respect the "required" attribute?

我想使用OpenID(PHP和LightOpenID)来获取以下用户信息:

    $openid->required = array(
      'namePerson',
      'namePerson/first',
      'namePerson/last',
      'contact/email',
      'person/guid',
      'birthDate/birthYear',
      'birthDate/birthMonth',
      'birthDate/birthday',
      'gender',
    );  

然而,我发现雅虎和谷歌都只返回以下数据:

 Array ( [namePerson] => abc [contact/email] => abc@example.com ) 

我的代码有问题吗?我可以强迫谷歌和雅虎返回我想要的所有数据吗?

Google和Yahoo OpenID实现都尊重Attribute Exchange中的"必需",但不是所有您要查找的属性。下面是他们各自的文档,列出了他们的模式支持的属性。

https://developers.google.com/accounts/docs/OpenID#Parameters

在发布此消息时,这些是当前支持的字段用于谷歌

  • 国家
  • 电子邮件
  • 名字
  • 语言

http://developer.yahoo.com/blogs/ydn/yahoo-openid-now-attribute-exchange-7795.html

在发布此消息时,这些是当前支持的字段对于雅虎

  • http://axschema.org/namePerson
  • http://axschema.org/contact/email
  • http://axschema.org/person/gender
  • http://axschema.org/media/image/default