views:

660

answers:

3

Based on this article, it seems like SO is using Javascript OpenID Selector (JOIS) to handle OpenID logins in its "view".

I love the simple interface and I would like to use it in a Rails project.

I know that RPX would probably be the easier choice, but I'd like to build this on my own.

Can you help me find answers to a few questions I have?

  1. Has anyone of you already done this or does anyone know of a good example?
  2. What setup (combination of plugins/gems) would you recommend if I'm using JOIS in my view?
  3. Is there a JOIS implementation (or anything similar besides RPX) based on Prototype instead of JQuery?
  4. Will I need another library besides the Ruby OpenID library to support all the account providers (OpenID, Google, Yahoo, etc.) supported by JOIS?

Thank you!

+2  A: 

In answer to #4, no. All the options provided by the OpenID Selector are standard OpenID Providers and the ruby OpenID library (I'm assuming you're talking about the Janrain one) supports all of them.

Sorry I can't help you with the rest. I haven't actually used the Ruby library myself for over 3 years.

Andrew Arnott
Thank you very much for you answer. But are Google and Yahoo really standard OpenID providers? I mean, Google for example doesn't provide a unique identification url as other OpenID providers do. You can see the different approaches by viewing the OpenID-Selector source: http://code.google.com/p/openid-selector/source/browse/trunk/js/openid-jquery.js
Javier
The word I was looking for is: Identity URL. :-) Google and Yahoo don't seem to provide one and something like the following line won't work with them: @user = User.find_or_initialize_by_identity_url(identity_url). Should I just switch to email as unique identifier for the user?
Javier
Google and Yahoo DO in fact provide a unique URL (it's called a Claimed Identifier) to users. But Google and Yahoo are unique in that theirs are usually very cryptic URLs that no user is expected to type in, so they rely on ALWAYS using an OpenID feature called 'directed identity'. Any Provider can use directed identity, but some don't support it. The special handling code in the OpenID Selector is likely to invoke directed identity when appropriate/necessary. Still standard stuff.
Andrew Arnott
P.S. It's probably a good idea to store the user's email address, but you should not key off of that as the user's primary key. That's what the Claimed Identifier is for. Better to just use email to help the user recover their account, if say, their OpenID Provider goes belly up or cancels their account.
Andrew Arnott
thank you andrew for guiding me to the "claimed identifier"! that helped me a lot!
Javier
A: 

I helped myself and implemented Javascript OpenID-Selector with Rails (though with JQuery instead of Prototype):

http://openid-example.joontos.ch/

Javier
Your link is broken
Jonathan
@Javier link is broken
piemesons
A: 
  1. I made open-selector.com as an alternateive to IdSelector. You're free to check the code and look at it (its just one .js file)
  2. There is really no need to mess with the server side authentication at all, as long as you can submit a form you're good to go.
  3. I used Jquery but mostly for altering CSS attributes and to help node selection, you can easily do this with any other JS framework
  4. If you're talking about a JS solution, it shoudln't matter what technology is behind the website login process (see #2). The OpenID Protocol aims to be provider agnostic so your standard OpenID library should do for any provider supporting OpenID (Google, Yahooo, MySpace, etc)
Jj