4

I will like to know how does Stackoverflow maintain the additional details of users logging in using open-ids? In my knowledge, the details of these users are stored in the server of google,facebook etc. (The ones whose open id is being used). How then this site is also storing info about user's points, badges, privileges etc.?

Open id Selector, the one being used by Stackoverflow, is a client side javascript library so how is this possible?

Is a separate database created? If yes, how? There is no registration even!

Please provide the details of how this is being done.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
Anand
  • 11,872
  • 10
  • 39
  • 51
  • Additionally, how do i get other info that is is stored in facebook/yahoo/google such as date of birth, city, place etc? – Anand Nov 15 '10 at 06:43

1 Answers1

4

When you login, the server checks if you already have an account. If there is no entry (it is the very first login), the server will automatically create a new user and save the openid identifier.

So the next time you login, the row is already there, and Stack Overflow will recognize you. By the way, you can learn the id of your database entry by looking at your profile url.

The JavaScript openid-selector is not involved in any of this. It just is a convenience feature which allows easy selection of an openid provider. All its magic is done before the openid magic takes place.

Sam Holder
  • 32,535
  • 13
  • 101
  • 181
Hendrik Brummermann
  • 8,242
  • 3
  • 31
  • 55
  • so, can i get other info about the open-id user which is stored in facebook/yahoo/google such as date of birth, city, place etc? – Anand Nov 15 '10 at 06:32
  • The openid consumer can ask for attributes when it redirects to the openid provider. The provider/user can decide if and which attributes are shared. Please note that Facebook does not support openid. StackOverflow just provides a unified user interface to both openid and Facebook. It may be a good idea to not implement openid yourself, but use an existing library. – Hendrik Brummermann Nov 15 '10 at 07:07