2013-06-24 64 views
1

我想用的OpenID(PHP和LightOpenID)得到以下的用戶信息:OpenID的Google和Yahoo實現是否遵守「required」屬性?

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

然而,我發現,雅虎和谷歌都僅返回以下數據:

Array ([namePerson] => abc [contact/email] => [email protected]) 

是我的代碼有問題嗎?我可以強制Google和Yahoo返回我想要的所有數據嗎?

回答

2

谷歌和雅虎的OpenID實現既尊重屬性交換中的「必需」,也不尊重你所尋找的所有屬性。以下是他們各自的文檔,列出了他們的模式支持的屬性。

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

在此張貼的時間,這些是目前支持的領域 爲谷歌

  • 國家
  • 電子郵件
  • 語言
  • 姓氏

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

在此張貼的時間,這些是目前支持的領域 雅虎

+0

雅虎網址:點擊項獲得404 谷歌網址:這麼多信息,我感到損失。 你能告訴我$ openid-> required中的可用字段嗎?非常感謝 – manhon

+0

支持的字段就在我發佈的兩個鏈接上,我相信axschema被openid.net取代,但字段名稱仍然相同 – ikumen

相關問題