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

笑着哭i 提交于 2019-12-11 12:42:04

问题


I would like to use OpenID (PHP and LightOpenID) to get the following user information:

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

However, I found that both Yahoo and Google return only the following data:

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

Is there something wrong with my code? Can I force Google and Yahoo to return all the data I want?


回答1:


Google and Yahoo OpenID implementations both respect the "required" in Attribute Exchange, but not all the attributes you're looking for. Here are their respective documentations listing what attributes their schema supports.

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

At the time of this posting, these are the currently supported fields for Google

  • country
  • email
  • firstname
  • language
  • lastname

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

At the time of this posting, these are the currently supported fields for Yahoo

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


来源:https://stackoverflow.com/questions/17281022/do-the-google-and-yahoo-implementations-of-openid-respect-the-required-attribu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!