Setting up OpenId for your site. OpenId delegation.

OpenId is a way of authenticating yourself on the increasing number of websites that support it. OpenId itself looks like url address, something similar to "janedoe.openid.com". There are several OpenId providers you can get your OpenId address from, but wouldn't it be nice to have "yoursite.com" for OpenId instead of "somename.someopenidprovider.com"? Apart from looking cool, it's a good way to promote your site as your OpenId is often displayed in signature field even where other html links are disallowed.

It's possible to set up your own OpenId provider, but for the purposes above (looking cool and self-promotion) it's really an overkill. Using existing provider is easier to set up and maintain and it serves the purpose just as well, so we'll start from getting an OpenId first. Hold on just a second and check if you have an OpenId already. You may not realize it, but if you have blogger blog (mine is isteriki.blogspot.com), wordpress or livejournal or some other well known account, you're all set. It does not matter that your blogger site is empty and it's called "mary-and-elvis-together-forever.blogspot.com" (and Mary turned out to be not that forever after all) while the site you want to use as OpenId is "elvisforever.com" - it's fine and valid for the purposes of this article as long as you still have the password from that "mary-and-elvis..." site (but remember to change it just in case so Mary will no longer be able to log in). You may skip the following paragraph if you have an OpenId already.

Otherwise go ahead and get one. Choose one of providers (or go straight to https://www.myopenid.com/) and register, it only takes a minute or two if you pause to make yourself some coffee.

Now that you have your OpenId, it's time to set up what's called "delegation" - delegate your website address to authenticate with the OpenId you've got. Find out OpenId server address. This will depend on the provider of your choice and it's buried somewhere in help section, for example with myopenid.com it is "http://www.myopenid.com/server". If you have your OpenId from blogger, wordpress or livejounal, open your homepage source code (right-click and view source) and look for a line like


<link rel="openid.server" href="your server address here" />

Let's summarize my assumptions so far: You've got an OpenId of "http://mary-and-elvis-together-forever.blogspot.com" and your OpenId server is "http://www.blogger.com/openid-server.g". The site you want to use with OpenId from now on is "elvisforever.com" (great name by the way, must be worth thousands). All you need to do now is to include the following into "<head>" section of elvisforever.com home page:

<head>
  ...
  <link rel="openid.server" href="http://www.blogger.com/openid-server.g" />
  <link rel="openid.delegate" href="http://mary-and-elvis-together-forever.blogspot.com" />
</head>

You are all set! Now go ahead and try using your new OpenId below:

OpenID:
See also Adding OpenId Delegation to Drupal 7 site.