Search code examples
springopenidspring-securityyahoo

OpenId attribute exchange is not working for yahoo?


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,


Solution

  • 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.