I recently started writing my own PHP OpenID class for a better understanding of openID. As a guide, I referenced the [LightOpenID Class] [1]. For the most part, I understand the code and how OpenID works. My confusion arises when viewing the author's discover function:
function discover($url) { if(!$url) throw new ErrorException('No identity supplied.');
Ok, here is the logic, as I understand it (mostly):
- Make sure
$url sends you a valid XRDS file, which is then parsed to find out the endpoint of the OpenID provider.- In my opinion, this is called the Yadis authentication method.
- If the XRDS file is not found, check the response body for the HTML <link> tag that contains the endpoint URL.
What .. Heck.
I mean seriously? Essentially the screen clears the answer and hopes you find a link with the corresponding attribute value?
Now, donโt get me wrong, this class works like a charm and it is awesome. I just don't understand two separate methods used to detect the endpoint: XRDS (yadis) and HTML.
My questions
- Are these two methods used only during the discovery process?
- Is only OpenID used in version 1.1 and the other in version 2?
- How important is it to support both methods?
- The site I encountered the HTML method is Yahoo. Are they nuts?
Thanks again for your time. I apologize if I am a little overwhelmed, but I was really overwhelmed by the methodology as soon as I began to understand what measures were being taken to find the final destination.
php openid lightopenid
Levi hackwith
source share