How To: Wordpress.com and the Simple OpenID PHP Class
25 Aug 2008 08:22 PM OpenID, PHP, Tutorials, Web Development, WordPressIn my previous post, I told you how to get the Simple OpenID PHP Class working with Yahoo. Now we’re going to focus on Wordpress.com. This turned out to be very easy once I realized the problem.
The Problem:
When you try to authenticate a WordPress OpenID using Simple OpenID you’re redirected to the correct URL, but it just displays your blog page rather than asking you to log in.
The Solution:
After a closer look at the URL we find the problem. The WordPress OpenID server URL takes the form http://username.wordpress.com/?openidserver=1. Fair enough. But the query string that we’ve appended with our request parameters also begins with a ? to set it apart from the rest of the URL. So, all we need to do is check the OpenID server URL we found during discovery for an existing query string. If it already has one, we’ll append our parameters with an &, otherwise we’ll use the ? as usual.
