openid/python-openid

Yadis Discover iterates through services

ziima opened this issue · 3 comments

When OpenID requests are created for provider which has several OpenID versions in its XRDS document, the most prior one is not used but instead they are iterated. I believe problem is at line 109 in yadis/manager.py which returns manager.next() instead manager.current()

I am not sure about consequences in YADIS protocol, maybe it is bug in yadis library as well.

Does your XRDS have one Service with multiple Types, or multiple Service elements? If you have multiple Service elements, this may be intentional behavior. Please provide a test case.

I have following XRDS:

<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds" xmlns:openid="http://openid.net/xmlns/1.0" xmlns="xri://$xrd*($v*2.0)">
  <XRD>
    <Service priority="10">
      <Type>http://openid.net/server/1.1</Type>
      <Type>http://specs.openid.net/extensions/pape/1.0</Type>
      <URI>https://test.provider/endpoint/</URI>
    </Service>
    <Service priority="0">
      <Type>http://specs.openid.net/auth/2.0/server</Type>
      <Type>http://specs.openid.net/extensions/pape/1.0</Type>
      <URI>https://test.provider/endpoint/</URI>
    </Service>
  </XRD>
</xrds:XRDS>

In specification of YADIS and XRD I found no notes about this. It says that element with highest priority should be used. But when I generate two requests at consumer they will have different service thus ignoring priorities.