ANN: Announcing OpenID Selector Module for Drupal

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:

Screenshot of Drupal login form with OpenID link

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

Screenshot of Drupal OpenID login form

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:

Screenshot of SourceForge OpenID login 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

Screenshot of Drupal login form with OpenID Selector 

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.

P.P.S.
Newer versions of the module do not require patching of Drupal core anymore.

P.P.P.S.
OpenID Selector is now available on Drupal.org at http://drupal.org/project/openid_selector, please download OpenID Selector from there.

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=...

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

patching the core is no

patching the core is no longer required, please download new OpenID Selector version

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

user login block is supported

user login block is supported now

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?

Which exactly OpenID

Which exactly OpenID providers do not work? What Drupal version/host OS are you running? Is your site available on the net, so I can try signing-in?

Only Google works, but i am

Only Google works, but i am uninstalling everything and trying to reinstall all. I'll let you know what happends.

ok, just in case, please

ok, just in case, please re-download and re-install openid-selector.zip, I have fixed a couple of bugs in newer version.

Please read about new version changes on drupal.org/node/838862 -- I am trying to make it "official" at drupal.org.

Ok, it seems that the problem

Ok, it seems that the problem is in my openid core files. Because even if openidselector is off i cant login with any other account than google. But still thanks for your help.

It seems that openID selector

It seems that openID selector is preventing openID registrations on my site: after enabling openID selector, attempts to register a new user with openID simply redirect back to the login page. Once i disabled it, i was able to login/register a new user without any problem. I am using drupal 6.19 on 64 bit linux, and the most recent version of your module. If it is convenient for you, please email me, and we can work together to figure out where this issue stems from.

Can you register w/ default

Can you register w/ default Drupal OpenID module? i.e. by pasting OpenID URL string in the default OpenID login form?

If you can't register w/ default OpenID login form, I guess this error might be related to http://drupal.org/node/451360

OS should not be a problem, I am using Ubuntu 64-bit too :)

Generally, some providers may block OpenID -- any problems w/ default Drupal OpenID mechanism must be fixed before installing OpenID Selector, kinda divide and conquer :)

User web browser could be a problem -- I have recently fixed couple of bugs occuring in Chrome, Safari and Opera -- please download newer version.

Is your website available online, so I can test the problem live?

Yes, the default OpenID

Yes, the default OpenID module works fine; as soon as i disabled OpenID Selector, I was able to register with my OpenID.

Browser should not have been the problem either, I'm using Firefox. I will update the module tonight though, and see if that helps.

The site is live, but only for testing at the moment, so I would prefer not to post the URL here; i have sent it to you through your contact form, with subject "OpenID Selector issue".

update for readers of my

update for readers of my blog: the problem is w/ default OpenID module.

P.S.
OpenID Selector is now available on Drupal.org at http://drupal.org/project/openid_selector

Doesn't appear

I've installed the module as per the README instructions. Installed the libraries module and the Javascript OpenId. Enabled all modules, including the original OpenID module under Administer > Site Building > Modules. What do I do next?

I don't see any options for any OpenId modules under permissions nor do I see any blocks pertaining to OpenId. On the login box/page it just shows the plain old OpenId URL field, same as in the profile edit page. Did I miss something?

I take that back

My mistake, I put libraries in the modules path 0__0 instead of the parent, all

Except...

When I move libraries from modules to the parent, all, Drupal Administration says that Libraries is no longer installed (missing). Your README instructions need to be fixed. In either case, it still isn't working on my end.

from the README:

2. Download Javascript OpenID Selector v1.2 from
http://code.google.com/p/openid-selector/downloads/list. Unzip the
contents of the openid-selector directory in the
sites/all/libraries/openid-selector directory.

Then it says:

The correct directory structure is as follows:
sites
all
libraries
openid-selector
css
images
js
demo.html
modules
openid_selector
...
openid_selector.module
...

README is correct in both

README is correct in both cases. JS must be installed in /sites/all/libraries/openid-selector, not "move libraries from modules to the parent, all," as you say.

So I can add myself to openid

So I can add myself to openid after im logged in but http://site.com/user/login shows the old openid box??

nvm... i didnt enable inline

nvm... i didnt enable inline

drupal openid not working correctly...

i am new to drupal just using it from few weeks now.i want to integrate openid on my site.so i installed the openid-selector .its showing up correctly only problem is its not letting me login directly with out the registration.after i authenticate at the google login its redirecting me back to registration page on my drupal site and display me this message "Please complete the registration by filling out the form below. If you already have an account, you can log in now and add your OpenID under "My account"."
i wanted to auto register the account. i am even using openid_autoreg module but not very helpful please help me out in solving problem....

see

see http://drupal.org/node/946998#comment-3628378 -- this is a patch that introduces attribute exchange to Drupal 6, code is backported from Drupal 7.

yahoo login not working...

hi

thank for the patch google login is working perfectly.but i am not able use yahoo and linkedin login to auto-register the account .please help out for this case.. i have installed linkedin dev module.

Private Openid

the selector should prominently invite those with private openid servers.
If a user's openid provider is not in the list, this is a disincentive to use openid for them.

Seamless login

Hi thanks for this great contribution to Drupal! I'm using latest version and having no issues, only a cheeky question =)

Can "clicking on the google image to login" be automated?

Explaination: You won't like my question considering the lovely design elements that your login box consists of, but, is there any way for me to do the following:

1) Anonymous visitor access my site: http://www.mysite.com
2) User is not logged in and therefor automatically redirected to Googles openid login
3) When user has authenticated with Google they are sent back to my site, logged in

So step2 is instead of clicking on the google image to login.

I've really tried getting this to work but it's too hard for me. I thought that accessing this url "https://www.google.com/accounts/o8/id?id=40-chars-here" after visiting http://www.mysite.com/user would result in the same thing as clicking the google image ;) However, there is some voodoo stuff going on that is just over my head.

Anyway, thanks for doing a great job!
Best regards,
Eriksson

Admin issues

The administrator might want to enter allowed OpenID-s for some users. Using OpenID Selector (I click on the OpenID button in the selector) to enter a URL I get immediately redirected to the login page (e.g. Google OpenID login) and the OpenID is not saved to the user profile. That is: on the administrator interface with OpenID Selector enabled the admin can only add (member) user OpenID-s that he actually possesses. (Disabling the module can solve the issue.) It would be nice to have a button disabling the Javascript that does the redirection.

Very complicate topic though!

Very complicate topic though! I'm impressed and enjoying announcement about openid topic. Thanks for such brilliant feedback indeed. Keep it up continue!

Definitely I was totally

Definitely I was totally amazed to hear that openid announcement. I believe that it bears very posting sounds. I hope I will select drupal module for my workshop. Thanks!

wondering

Hi I was wondering if it's possible to grab the full name as a login name. Instead of asking the user to type one. Quite the same as the form to ask this question, My name was filled in 2.

Sound like good posting. I'm

Sound like good posting. I'm very pleased to know about openid announcement. Its true that drupal module will be effective for any workshop. Thanks

URL

It would be nice to have a URL box for those of us with private Openid servers.
On the regular Openid, a cookie stores the last URL and puts it in the box.
Not to say that having the facebook, google et al available as icons is not necessary, but the option of having a box would be nice also.
Some of us would like to just have a few. Setting the configuration so you can checkbox the icons you want to show up would be nice.

Render form programmatically

If I try to render the user login form programmatically, the form reverts to the version without OpenID Selector

eg.
Create a new block with this php:
<?php
$blk = module_invoke('user', 'block_view', 'login');
print render($blk);
?>

Display the block in a region, OpenID Selector not shown - standard OpenID form is shown.

I have also tried :
$frm = drupal_get_form('user_login_block');
print render($frm);

with the same result.

(I am trying to do this to render the form in page.tpl.php outside of a normal region)

Any idea's how I can do this?

Bizarre

Hmmm

ignore this
If I display the login block twice, using whatever method, it reverts to the standard.
If I display it only once, I get the OpenID Selector.

So from my point of view, it works as I require! Thanks for a great module
(D7 BTW)

Post new comment

The content of this field is kept private and will not be shown publicly.