Drupal's OpenID module is somewhat not complete.
If you enable OpenID module in Drupal, it modifies user/login screen with "Log in using OpenID" link:

and when you click on that link, OpenID login form pop's up:

This form was always puzzling me: instead of remembering passwords, are now users supposed to remember their OpenID URLs?
For example, Google's OpenID URL format is "https://www.google.com/accounts/o8/id?id=<40-digit hash code>", and if user wants to login w/ Gmail account, is user supposed to type-in that string, or copy-paste the string from some place?
This form does not make Drupal's default login form any simpler, it makes it only harder. That's why I was never enabling OpenID module on any of my Drupal sites.
However, recently I was visiting SourceForge, and noticed they have incorporated OpenID login in a lot nicer form:

After viewing page source, I have figured out they are using openid-selector Javascript library from http://code.google.com/p/openid-selector/
Brief googling for "Drupal OpenID selector" did not produce any reasonable/good looking results except some weird commerical product at https://www.idselector.com/ (why make so simple thing so complex?)
Then I decided to write my own module integrating Javascript OpenID selector into Drupal.
After one day of heavy tweaking, I was able to marry it w/ Drupal's OpenID module.
Below is a screenshot of how OpenID login form now looks at http://www.gerixsoft.com/user/login
User profile's "OpenID identities" form at "/user/<id>/openid" has been enhanced w/ openid-selector as well.
Now, I release the module integrating OpenID Selector w/ Drupal as open source under GPL v2 license. You can find it attached.
Feel free to use it on your websites and unveil the true power of Drupal's OpenID module!
P.S.
The only drawback of the module is that it requires patching of Drupal core. After you've enabled it, you should open /modules/openid/openid.js, and comment out the following code (at line #23 as of Drupal version 6.17):
$("#edit-openid-identifier")[0].focus();
You should restore(uncomment) this line back on disabling the module.
| Attachment | Size |
|---|---|
| openid-selector.zip | 26.43 KB |
Comments
Looks great, but I get a
Looks great, but I get a 404/page not found error after trying to log in with Google.
This is the URL I am sent to:
http://www.gerixsoft.com/openid/authenticate?destination=user&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id_res&openid.op_endpoint=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fud&openid.response_nonce=2010-07-26T15%3A02%3A04ZpJzQtcc9YIIbvQ&openid.return_to=http%3A%2F%2Fwww.gerixsoft.com%2Fopenid%2Fauthenticate%3Fdestination%3Duser&openid.assoc_handle=AOQobUe-C8H13GAVgFql-4SnEXp3jqogIasZ21v4IUHRxVLAH0x2JORm&openid.signed=op_endpoint%2Cclaimed_id%2Cidentity%2Creturn_to%2Cresponse_nonce%2Cassoc_handle&openid.sig=ey4guCr%2BvI%2FiwJYGD7%2FEcfCudUw%3D&openid.identity=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawmAygTGN347rmhqPjWkrLl9OAkBYWYRYrg&openid.claimed_id=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawmAygTGN347rmhqPjWkrLl9OAkBYWYRYrg
Also, I wish we didn't have to patch core.
on 404/page not found: this
on 404/page not found:
this is a configuration problem, to fix read this post.
on patching Drupal's core:
yes, I know this is not good, will come up w/ better solution soon
Thanks
Doesnt show the selector
This module does show the selector to add your ID to your profile, but not on the index page. It keeps showing the "old" type your url openid login at the loginbox. What am I doing wrong?
only full login form at path
only full login form at path "/user/login" is supported as of now.
will make login block (box) supported soon.
ok thnx
ok thnx
It seems I can only login
It seems I can only login with google openID even though i tried to login in with different (offcourse existing) accounts or trying to attach them to an existing drupal account. It keeps saying that the accounts don't exist. I used your .zip and patched the core. I can't find where it goes wrong in the code and on the gerixsoft site it works like a charm. Can you help me again?
Post new comment