title: Creating a OpenID Provider in PHP
body: <p>I have an existing website that I want to turn into an OpenID provider. All my user accounts are stored in a mysql table.</p>
  
  <p>I figured since an OpenID is represented as a URL, I am going to do something like: <a href="http://login.mydomain.com/username" rel="noreferrer">http://login.mydomain.com/username</a></p>
  
  <p>I've setup a subdomain, and created an htaccess that redirects all URLs to /login.php?username=[username]</p>
  
  <p>The way I see it, and tell me if I'm wrong, someone goes to let's say StackOverflow, they enter <a href="http://login.mydomain.com/myUsername" rel="noreferrer">http://login.mydomain.com/myUsername</a>. They get to a page on my server that asks for their password (since I already know their username), I check that it matches, and return the key?</p>
  
  <p>People online recommended using Zend_OpenId_Provider. I've been reading their documentation (<a href="http://framework.zend.com/manual/en/zend.openid.provider.html" rel="noreferrer">http://framework.zend.com/manual/en/zend.openid.provider.html</a>), but I find it very confusing. They have no real world example where the user login/password are stored in a database.</p>
  
  <p>I've also seen php-open-id (<a href="http://github.com/openid/php-openid" rel="noreferrer">http://github.com/openid/php-openid</a>), but no help there either.</p>
  
  <p>It seems to be a pretty common thing to do. Is there a tutorial out there or an example I can easily adapt?</p>