Database Schema for multiple authentications, Facebook Connect, Twitter, OpenID, etc

前端 未结 2 1471
予麋鹿
予麋鹿 2020-12-24 02:44

I am building an application that I want to interface with Facebook Connect, Twitter, OpenID, and potentially other social networks. Users will be able to login using any n

2条回答
  •  渐次进展
    2020-12-24 03:30

    This is what i do, i separate the accounts table from the authentication process, e.g. the account holds the account name, registration date, and unique id maybe. Then I can create 4 additional tables for example: users_openid, users_facebook, users_twitter and users (for your normal username/website authentication), all have a foreign key (account_id) that links to the account table.

    This way you separate how the user sign-in to your system and the actual account.

提交回复
热议问题