How to Be Your Own OpenID Provider and Use Your blog’s URL for Identification

If you have a self-hosted blog, meaning that you have the access to the files on the server, then implementing OpenID might be the greatest way to help your readers and yourself.

If you haven’t heard about the OpenID before, then in a nutshell it is your universal login name, which you can use to authenticate yourself on other blogs and websites without ever filling out those registration forms again. The illustration below shows how it works:

How OpenID works

There are only three components involved: you and your OpenID indentifier which you have set up on your own OpenID Provider server.

However, keep in mind that in case you don’t have the access to a web server, you can still create an OpenID identifier at any of the Identity Providers such as Flickr, Blogger or Yahoo. You might even have one if you blog at WordPress.com. I strongly suggest that you read this excellent explanatory article by Sam Ruby to get a sense of how OpenID can work for you.

In this article I will show you how to:

install a single user OpenID Identity Provider called phpMyID on your web server,

configure your blog so that it’s URL is your OpenID identifier, and

enable OpenID authentication on your blog, so that readers can use their OpenIDs to leave comments.

If you already have an OpenID account at one of the Identity Providers and you simply want be able to use your blog’s URL for authentication, skip the phpMyID installation part and go directly to step 3.

Installation Guidelines

These instructions contain only the main points you should follow. If you want to have something configured differently than I have suggested, then feel free to do it.

Download phpMyID and extract it somewhere on your computer. Notice that there are only two .php files and one .htaccess file to get things working.

Read through the README file that is in the same package which you just extracted.

Decide the URL you would like to use for the phpMyID identity provider. I am using konstruktors.com/id. Notice that this URL is used for placing the Identity Server only, and you will be still able to have the blog’s URL for authentication (after installing the WP-Yadis plugin).

Edit and complete the MyID.config.php file as described in README and then rename MyID.config.php to index.php just before uploading it to the server. This way you’ll be able to use yourblogsurl.com/id instead of yourblogsurl.com/id/MyID.config.php in future.

Go to the URL you chose previously and see if it works. If it doesn’t, try reading through the README file again a few times or download a fresh copy of phpMyID and start over. It should work. Move on to the next steps once you have got it working.

You could use this URL for authenticating on any of the OpenID enable websites, but we want the blog’s URL, so let’s continue.

Download WP-Yadis plugin, unzip it, upload it to the plugin folder of your WordPress installation, activate it, go to WordPress Settings and click on ‘Yadis’ in the menu.

Let’s add the details for the Indentity Server we created in the previous step. Select Other in the drop-down menu. Username is the one you chose ('auth_username' => '...') when editing MyID.config.php file. Mine is kaspars. For OpenID Server enter the URL of your Identity Server http://yourblogsurl.com/id/ and for OpenID Delegate enter http://yourblogsurl.com/id/index.php

Download WP-OpenID* plugin, extract it, upload it to the WordPress plugin folder, activate it and you should now see an OpenID icon in the background of the ‘Website’ input field in the comment form (when you are logged out). If you would also like to use OpenID for logging into the administration panel of your blog, go to ‘Users’ > ‘Your Identity URLs’ and add the URL of the Identification Server http://yourblogsurl.com/id/index.php.

Thats All. You now have a complete control over your identity on the Web, and your blog’s URL together with your name and e-mail address will be used automatically when leaving comments on other websites.

Notes & Known Problems

* Currently I am not using the WP-OpenID plugin because the JavaScript it uses for adding the input field’s background image seems to produce errors, but it might work well for you. I have got it working by simply removing the jquery.xpath.js file from the files directory inside the openid folder. It seems that the XPath compatibility provided by this file is now built into the jQuery core.

Therefore you can now test your OpenID by leaving a comment on this article.

If you experience any errors or problems, be sure to search through the WordPress Support forum and also consult the Google.

Yeah, I have removed the OpenID server from the site since I was not using it that much. Also the client part is gone because the plugin was causing too many issues with people not being able to leave comments although their URL was not an OpenID endpoint.