OpenId 属性交换对 yahoo 不起作用?
我正在使用 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 登录
时得到以下输出...
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,并且我得到了我要求的所有属性...
提前致谢,
I am using Spring Security 3.0.5 for providing openid support to my web site. I have written following code in my 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>
Than I acces the attributes using OpenIDAuthenticationToken
... For debugging purpose I have printed the value on console... I have printed the parameters... I get following output while trying for 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)**
the same code works fine for gmail and I get all the attributes I asked...
Thanks in advance,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个问题很老了,但希望对其他人有帮助。
我们必须使用电子邮件属性名称而不是 axContactEmail 或 oiContactEmail
我的配置适用于 Google 和 Yahoo! :
了解更多
This question is old, but hope to help others.
We must use email attribute name instead axContactEmail or oiContactEmail
My config works with both Google and Yahoo! :
Read more
这个问题可能重复。 AX 属性不保证任何 OpenID 提供商都支持,并且不同 OpenID 提供商之间肯定存在很大差异。对于这些特定的示例,Yahoo 在响应 AX 请求时肯定会返回很少的信息,而 Google 返回的信息会稍微多一些。 (大约一年前,当我为我的书做研究时,MyOpenID 拥有主要 OpenID 提供商中最完整的 AX 支持)。
您可能应该查看一些属性交换规范以及有关 OpenID 的其他架构信息(如果您正在计划一些重大实施计划)。
Possible duplicate of this SO question. AX attributes are not guaranteed to be supported by any OpenID provider, and definitely do vary widely from OpenID provider to provider. With these particular examples, Yahoo definitely returns very little information in response to AX requests, and Google returns slightly more. (At the time I was doing the research for my book a year or so ago, MyOpenID had the most complete AX support of the major OpenID providers).
You should probably review some of the specs on attribute exchange and other architectural information about OpenID if you are planning some major implementation initiative.