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

前端 未结 2 1463
予麋鹿
予麋鹿 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:27

    I suggest you have your User schema in two tables: Users and Identities. Identities should have: Id, User Id, Adapter, Hash.

    For username/password authentication adapter, the Hash will be a hashed (MD5/SHA1 for example) password, while other adapters (Facebook, Twitter, etc) will be the token provided by Auth Provider.

    Good luck.

提交回复
热议问题