Tag Archives: openid

Why I love Ruby on Rails… impement a new feature in about an hour

Yes, I’m a fanboy, but with good reasons.

Tonight I decided that I’d really like to add openid support to the MHVLUG Event Calendar.  Accounts aren’t used that much in it, because you have to be in the admin role to notice any difference.  However, it’s just one less field for me to have to fill in.

So, the 6 million dollar question, what was the duration of time between deciding I’d like to do this (though having no idea how), and having a working implementation…

65 minutes.

Which included getting up to get dinner in the oven.

In blow by blow format:

  • A quick bit of googling got me to the openid-authentication railscast, which I watched all the way through.
  • I fixed a couple of his refactoring bits to work with newer restful_authentication.
  • I also installed an old open_id_authentication plugin the first time, which gave me an exception.  Make sure to get the latest on github.
  • I modified my user to have my identity_url using the rails console
  • I used the rails debugger to figure out that I needed an extra slash on the end of my identity_url, which is why my login with openid wasn’t working

Which is a pretty serious amount of bouncing around because I had no idea what I was doing when I got started.  That will turn subsequent openid enablement into a 15 minute exercise.

OpenID and Gravatars

… also known as – please don’t make me fill out those same 6 fields to get into your website!

A few weeks ago I gave an MHVLUG talk on Ruby on Rails.  At the normal dinner outing afterwards one of our members was talking about maybe creating a small rails application where people could share and publish the podcasts they listen to, which I think is a great idea.  (Hopefully they’ll work on it at our web-hack-a-thon.)  But that lead into the inevitable issue of “user accounts”.

Man, I hate having more user accounts.  And if we are going to do this project, I really didn’t want everyone in the LUG to have to have another one.  So I resolved to see what I could do about reusing the MHVLUG accounts in an external way.  It’s actually pretty easy as there is a Mediawiki OpenID extension which lets you go both ways.  You can enable OpenID logins to the wiki, and make people’s user pages OpenID providers.  Rails has a very good openid plugin (plus it’s integrated as part of the restful-authentication-tutorial) so that would make it trivial to write an application that people can log in using their MHVLUG password (the id will be a bit different, but that’s explainable).  While Facebook and Google are still dragging their feet a bit here, Yahoo, AOL, and WordPress.com are all on the bandwagon, so many people already have these ids, they just don’t know it.

That got me following a few threads on OpenID, and looking at WordPress.  It turns out that WordPress also has a good OpenID plugin.  What’s quite interesting about that plugin is that it can make a wordpress instance the OpenID provider for 1 of the WordPress users.  So if you have a personal blog, it means you can now very easily be your own OpenID.  Being able to login in as http://dague.net is quite convenient.

Lastly, I wanted to throw something in about gravatars.  You know how everyone wants you to upload your picture to their website?  Stop the madness!  Gravatars are just keyed off your email address, so if an site has that, they can look you up, and get your profile pic from the gravatar folks.  Newer wordpress templates automatically integrate this.  I did minor adjustment to my template to get this support in there.  I’ve sworn now that Meetup.com is the last people I’m ever uploading a picture for, and that’s just because it’s hard to find complete strangers in a dinner without photos.  Again, there is a good rails plugin for this, so it’s pretty trivial to integrate if you are doing a Ruby on Rails application.

So, if you are a web2.0 hipster, and thinking about making a new service, please don’t make me create a new account, because, honestly, that’s getting close to being a deal breaker for me at this point.  And if you want my picture, the gravatar people have it.  I’m not uploading it for you again. 🙂