phpMyId 0.7
Since I last looked at phpMyId, it has progressed from version 0.3 to version 0.7. A number of changes occurred.
For starters, the code has been split into two files, MyID.config.php and MyID.php. The idea is that the former is the only file a typical user would need to modify. I just don’t happen to be a typical user. :-)
Decrufting is still possible, simply rename
MyID.config.php
toindex.php
, and add a line to the$GLOBALS['profile']
section like this one:'idp_url' => 'http://intertwingly.net/id/'
With this version of phpMyId, the server and delegate URIs must match, so if you use traditional autodiscovery approach, both the
openid.server
andopenid.delegate
links will need to be present. In the YADIS file, simply make theopenid:Delegate
andURI
elements match.I briefly looked into adding a
delegate_for
profile option, whose value would be a regular expression of URIs that this service would vouch for. Unfortunately, this would require that the code base be more careful about keeping these two values separate. As I still have my 0.3-based identity around, I simply have the autodiscovery link point to my 0.3 identify (for old clients), and have my YADIS file point to my 0.7-based identify (for new clients).The most significant change was that this codebase uses HTML based refreshes in place of HTTP redirects in more places. The HTML page itself is hardcoded, spartan, and (to my tastes) unnecessarily distracting when used in the normal flow of a successful login. I made the following changes to my copy to address this:
In
wrap_location
:function wrap_location ($url, $keys = array()) { $keys = append_openid($keys); debug($keys, 'Location keys'); $q = strpos($url, '?') ? '&' : '?'; if (empty($keys)) $q = ''; header('Location: ' . $url . $q . http_build_query($keys)); debug('Location: ' . $url . $q . http_build_query($keys)); exit(0); }
In
authorize_mode
:// return to the refresh url if they get in wrap_location($_SESSION['post_auth_url']);
In
checkid
:// $q = strpos($profile['idp_url'], '?') ? '&' : '?'; // wrap_refresh($profile['idp_url'] . $q . 'openid.mode=authorize'); wrap_location($profile['idp_url'], array('mode' => 'authorize'));