Adding OpenID to a Drupal 4.6 website
Over on Change.org, there is a discussion about Adding OpenID support to Change.org. What’s good for the gander is good for the goose, so I thought I should investigate adding OpenID to Orient Lodge.
For those of you who aren’t acquainted with OpenID, it is “an open, decentralized, free framework for user-centric digital identity.” The first thing that is needed for such a framework is a way of authenticating identity. So, instead of having to keep track of passwords for lots of different systems, using OpenID, you can have one password, authenticated at a specific place, which is used to sign in at many sites.
Currently, if you have userids at LiveJournal, Wordpress, Vox, AOL, you have an easy to use OpenID userid already. If you use Yahoo!, you can indirectly use idproxy.net. You can also add code to your own site so that it will point to one of these as the authentication service. Currently, Orient Lodge is pointing to my Yahoo! id via idproxy.net.
All of this is well and good, if you can log into other sites using OpenID. Slowly, more and more sites are supporting OpenID, and now (at least until something breaks), you can log into Orient Lodge using OpenID. Read the details below the fold.
First, you need to find an OpenID login. For Livejournal, Wordpress and Vox, it is easy. Enter the URL for your site, e.g. http://aldon.livejournal.com/, http://aldon.wordpress.com/, or http://ahynes1.vox.com/. If you are using AOL, add your Screenname after http://openid.aol.com. So, for example, my OpenID login via AOL is http://openid.aol.com/ahynes1
As noted, you can also use idproxy.net to tie into Yahoo!. There are other standalone OpenID sites, like myopenid.com. http://claimid.com is a site where you can start linking all of them together.
So, to login to this site using OpenID, enter your OpenID address in the box on the left. The first time you do this, it will ask for an email address. Drupal wants to have an email address for everyone who can log in. Please, help me out. Find an OpenID that you can use, and then login with it and add a comment.
For the geekier people here, let me go through the details that I went through to get this to work on Orient Lodge. I started off by going to http://www.openidenabled.com/, where I downloaded version 1.1.1, works with PHP OpenID 1.1.0 and Drupal 4.6. I moved the module into my modules directory, and renamed it accordingly. I then downloaded PHP OpenID library version 1.2.2. I added symbolic links for the Auth subdirectory and the Services subdirectory.
When I loaded the module, I started getting PHP errors. There were problems finding ‘gmp’. I commented out lines 365-368 which checks for libraries, and things started working, almost.
For some reason, the login using the normal Drupal login screen didn’t work. However, adding the OpenID block and logging in there got me a bit further.
Unfortunately, the form to ask for the email address wasn’t working. I changed lines 241 and 290 to go to get_email instead of openid/get_email and everything started working okay.
Once I logged in, I found one final problem. On line 297, it was assigning any new OpenID users to the role, DRUPAL_AUTHENTICATED_RID. However, for some reason, that didn’t work and users weren’t getting assigned to any role. I replaced the value with a 2, and everything seems to be working okay.
So, please, give it a try, and let me know how it works for you.
Testing
Submitted by http://aldon.wo... on Thu, 05/31/2007 - 14:58. span>Well, my test from LiveJournal is currently failing, but it appears as if LiveJournal is having some problems. I've logged in with WordPress and it looks like it is working properly.
Vox seems to work as well
Submitted by http://ahynes1.... on Thu, 05/31/2007 - 15:01. span>So far so, good.
AOL works but...
Submitted by http://openid.a... on Thu, 05/31/2007 - 15:05. span>It doesn't appear to display the username very nicely. Oh well.
ID Proxy seems to work
Submitted by http://ahynes1.... on Thu, 05/31/2007 - 15:07. span>This was the first that I tested, but now I completing a more complete set of tests.
MyOpenID works
Submitted by http://ahynes1.... on Thu, 05/31/2007 - 15:11. span>Just about done testing.
LiveJournal is back
Submitted by http://aldon.li... on Thu, 05/31/2007 - 15:13. span>and appears to be working smoothly.