How to use BlogEngine.net as an OpenID provider

by matt 16. April 2009 22:39

openid-icon-100x100

One of the nice things about OpenID is that just about anyone can be an identity provider. Indeed, that’s pretty much the point.

OpenID is just a URL. Specifically, a URL that uniquely identifies you and that you and only you have control over.

You know, like your blog address.

So let’s make BlogEngine.net be an OpenID. Turns out, it’s dead easy.

1. Go and get an OpenID

What? Did you think we’d do the heavy lifting ourselves? No, no, no. Friends don’t let friends try and implement security protocols. Leave it to the professionals.

Put it this way – I don’t even want to have to get https working as a part of my blog, let alone implement OpenID security exchanges.

I used the guide available at Will Norris’ site to help make a choice of which 3rd party to help decide which to go for. As far as I can see, the two best choices are MyOpenID and MyVidoop. Both look like very good providers, offering just about everything – attribute exchange, personas - but I went with MyOpenID because they support logging in using CardSpace (we have history).

So, my OpenID is http://mtellis.myopenid.com.

2. But I thought you said you could use your blog address?!

Of course. OpenID supports delegation. This allows me to have an OpenID URL that delegates to another OpenID provider. In other words, when I try to log in to a site using this blog as an OpenID, this blog will actually delegate responsibility to the “real” OpenID provider, MyOpenID.

This is very easy to set up. You just need to add a few lines of HTML to your blog.

First, find the help pages for delegation for your OpenID provider. Here they are for MyOpenID, and here they are for MyVidoop.

Now log onto your instance of BlogEngine and go to the settings page. Towards the bottom of the page, there is a text box labelled “HTML Head Section”. Paste the HTML from the help pages into this box, and save.

This is what mine looks like:


<link rel="openid.server" href="http://www.myopenid.com/server" />
<link rel="openid.delegate" href="http://mtellis.myopenid.com/" />
<link rel="openid2.local_id" href="http://mtellis.myopenid.com" />
<link rel="openid2.provider" href="http://www.myopenid.com/server" />
<meta http-equiv="X-XRDS-Location"
content="http://www.myopenid.com/xrds?username=mtellis.myopenid.com" />

Of course, these are my details – make sure to put yours in.

And don’t worry, I’m not showing you anything sensitive here. This information is plainly visible to everyone with a simple view source – there are no secrets here.

What this is doing is telling the web site you’re trying to log into that you have delegated your OpenID. You tell it the server it needs to speak to (http://www.myopenid.com/server) and who that server knows you as (http://mtellis.myopenid.com in my case).

3. Let’s log in to something!

The simplest was to test is to go to this checkup page, which will try and log in for you. Enter your blog address, (http://sticklebackplastic.com) in the text field and hit check. If all is well, you should see something like:

 CheckingOpenId

This shows that the checkup site, my blog and MyOpenID can all talk together properly.

Now click the “Try logging in” link.

This time, you should get redirected to your OpenID provider. Here, MyOpenID is telling me who is trying to authenticate (openidenabled.com) and prompts me for my password (or Information Card – yay for phishing resistant logins!).

MyOpenIDSignIn

Once I’ve successfully authenticated with MyOpenID, I’m redirected back to the test page, where it confirms that everything is working as it should.

SuccessfullyLoggedIn

And there you have it.

Three simple steps, and now your blog is your OpenID. Go use it to log in to all those sites with the cute little openid-16x16 icons. Go on, shoo.

Tags: , ,

Comments

4/28/2009 10:06:08 PM #

EDI

This looks like really great stuff. I am glad you included the code, makes it a lot easier to understand.

EDI United States | Reply

4/29/2009 7:21:21 PM #

brodband in london

Which openID provider would you recommend ? I know that you can also delegate your own domain as being the provider for your login

brodband in london United States | Reply

4/30/2009 9:30:38 AM #

matt

Well, I'm happy with MyOpenID.com. They're one of the providers that support just about everything that OpenID has to offer, and, since I'm a bit of a CardSpace geek, I like that you can use it to log in.

matt United Kingdom | Reply

5/10/2009 10:19:27 AM #

Leadership Theory

I find that the support at MyOpenID.com is a little dissapointing, dont you? Or have you never had to lean on it?

Leadership Theory United Kingdom | Reply

5/16/2009 4:19:59 PM #

matt

Haven't had to lean on it. I've only recently dipped my toes into OpenID, so haven't used it much. I basically flipped a coin as to who I would go with...

matt United Kingdom | Reply

Add comment


(Will show your Gravatar icon)

biuquote
  • Comment
  • Preview
Loading



About the author

Something about the author

Calendar

<<March 2010>>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

RecentComments

Comment RSS

License

Creative Commons License
Except where otherwise noted, content on this site is by Matt Ellis and is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.

©2010 Matt Ellis