【问题标题】:OpenId attribute exchange is not working for yahoo?OpenId 属性交换不适用于雅虎?
【发布时间】:2011-11-06 19:16:32
【问题描述】:

我正在使用 Spring Security 3.0.5 为我的网站提供 openid 支持。我在 Spring-Security.xml 中编写了以下代码

<security:attribute-exchange>
                <security:openid-attribute name="axContactEmail" type="http://axschema.org/contact/email" required="true"/>
                <security:openid-attribute name="oiContactEmail" type="http://schema.openid.net/contact/email" required="true"/>
                <security:openid-attribute name="axNamePersonFullname" type="http://axschema.org/namePerson" required="true"/>
                <security:openid-attribute name="axNamePersonFriendlyName" type="http://axschema.org/namePerson/friendly" required="true"/>
                <security:openid-attribute name="axNamePersonFirstName" type="http://axschema.org/namePerson/first" required="true"/>
                <security:openid-attribute name="axNamePersonLastName" type="http://axschema.org/namePerson/last" required="true"/>
            </security:attribute-exchange>

比我使用OpenIDAuthenticationToken 访问属性...出于调试目的,我已经在控制台上打印了值...我已经打印了参数...我在尝试Yahoo login 时得到以下输出...

Email Address  : null
Full name  : null null
Prefered login  : null.null
Identifier here  : https://me.yahoo.com/a/L73gX9Yjkt2SKmqcgkzrbF7gGjRP **(correct!!! I have checked it)**

相同的代码适用于 gmail,我得到了我所要求的所有属性...

提前致谢,

【问题讨论】:

    标签: spring openid spring-security yahoo


    【解决方案1】:

    this SO question 可能重复。不能保证任何 OpenID 提供者都支持 AX 属性,并且肯定会因 OpenID 提供者而异。通过这些特定示例,雅虎在响应 AX 请求时返回的信息肯定很少,而谷歌返回的信息略多一些。 (大约一年前,当我为我的书做研究时,MyOpenID 拥有主要 OpenID 提供商中最完整的 AX 支持。

    如果您正在计划一些主要的实施计划,您可能应该查看一些specs on attribute exchange 和其他有关 OpenID 的架构信息。

    【讨论】:

      【解决方案2】:

      这个问题很老了,但希望对其他人有所帮助。

      我们必须使用电子邮件属性名称而不是 axContactEmail 或 oiContactEmail

      我的配置适用于 Google 和 Yahoo! :

      <security:attribute-exchange>
      <security:openid-attribute name="email" type="http://schema.openid.net/contact/email" required="true"/>
      <security:openid-attribute name="forename" type="http://schema.openid.net/namePerson/first" required="true"/>
      <security:openid-attribute name="surname" type="http://schema.openid.net/namePerson/last" required="true"/>
      <security:openid-attribute name="name" type="http://schema.openid.net/namePerson/friendly" required="true"/>
      <!--Yahoo-->
      <security:openid-attribute name="fullname" type="http://axschema.org/namePerson" required="true"/>
      <security:openid-attribute name="email" type="http://axschema.org/contact/email" required="true"/>
      

      Read more

      【讨论】:

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