Search code examples
authenticationopenidopenid-selector

How does stackoverflow maintain a database of Open-id signed-in users?


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.


Solution

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