【问题标题】:Yahoo! OpenID doesn't include Attribute Exchange info (using python-openid)雅虎! OpenID 不包括属性交换信息(使用 python-openid)
【发布时间】:2010-04-18 21:54:23
【问题描述】:

我正在使用 python-openid 成功地将我的基于 python 的站点与 OpenID 连接起来。它适用于谷歌,它适用于雅虎!但与雅虎!属性交换似乎不起作用。我只得到电子邮件地址。名字、姓氏和国家始终为空白。我知道雅虎!帐户(通过该电子邮件地址)定义了名字和姓氏。

我在普通的 OpenID 参数中使用这些参数:

    'openid.ns.ax':'http://openid.net/srv/ax/1.0',
    'openid.ax.mode':'fetch_request',
    'openid.ax.required':'firstname,lastname,email,country',
    'openid.ax.type.firstname':'http://axschema.org/namePerson/first',
    'openid.ax.type.lastname':'http://axschema.org/namePerson/last',
    'openid.ax.type.email':'http://axschema.org/contact/email',
    'openid.ax.type.country':'http://axschema.org/contact/country/home',

搜索我找到了this answer,但我不熟悉 PHP 框架及其对“计数”的使用。 python-openid 框架中没有这样的东西。

【问题讨论】:

    标签: python openid python-openid


    【解决方案1】:

    也许迟到总比没有好。我只是在 Perl 中使用 Net::OpenID::Consumer 包测试同样的东西,并且遇到了类似的问题。我首先发现 yahoo 没有 firstname 和 lastname ,而是必须定义另一个指向 axschema 类型 http://axschema.org/namePerson 的类型,并且您也可以请求他们的媒体图像,但是 first name 和 lastname 将永远无法使用。

    yahoo 的 openid 属性交换的文档在这里(这很糟糕,恕我直言,但与此同时,开发人员需要知道如何定义类型并将它们指向正确的模式值):@987654322 @。

    这与 google 不同,您可以请求的值是国家、电子邮件、名字、姓氏和语言,这里有更好的记录:http://code.google.com/apis/accounts/docs/OpenID.html

    考虑到差异,为列出的每个提供商提供不同的返回 URL 可能是谨慎的。我没有列出 MyOpenID 的属性,因为我还没有测试它。

    【讨论】:

      猜你喜欢
      • 2011-11-06
      • 1970-01-01
      • 2011-04-28
      • 2013-05-13
      • 1970-01-01
      • 1970-01-01
      • 2013-06-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多