Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do all those Javascript OpenID libraries work?

There are several OpenID libraries implemented in Javascript (like openid-realselector, openid-selector, jquery.opendid). How do all these work? Do they just provide and call the OpenID provider and then the provider provides some data (how?) and redirects back to my site (to where exactly?)? And now is it my part on the server side to fetch that data somehow and use it to log in my user? I looked at the code of openid-selector, but don't see where to provide a callback url to my site. So I am not sure anymore if the above scenario is really the way how this all works.

like image 795
Zardoz Avatar asked Nov 26 '10 10:11

Zardoz


1 Answers

The libraries you have mentioned are OpenID selectors, that is, glorified forms allowing for easy selection of a provider. They have nothing to do with the protocol, which must be implemented server-side.

As for "how do they work", they simply submit a form with a certain field (openid_identifier). Depending on the button you click, that field has different values, and if you don't click on any, you simply have to input it yourself. Then, a server-side code gets the value, passes it to a library that does handles openid.

You can find a list of OpenID (server-side) libraries on http://openid.net/developers/libraries/.

like image 131
Mewp Avatar answered Oct 17 '22 23:10

Mewp