Why does asp.net membership have a users table and a membership table?

做~自己de王妃 提交于 2019-12-09 09:25:44

问题


Why do they split up the users stuff into 2 tables? Like they got aspnet_ membership and aspnet_users.

Is it just because the membership stuff they have is so long?


回答1:


It's to separate identity/authentication management from membership management. The "big" user table is the actual identity repository - e.g., if you want to use SQL to store your identity data, it all goes in here. But you may want to use some other source - say, Active Directory - to be your identity repository. You validate identity and authentication against that instead, but you still need to have some way to join the SQL-based role/membership data to the AD-based identity data. That's where the smaller table comes in - just enough info to maintain those relationships.




回答2:


It's for securing multiple applications from a single user database; aspnet_membership has UserId and ApplicationId so each user can have a different password for multiple applications (and also be locked out of one application but not another).



来源:https://stackoverflow.com/questions/1489809/why-does-asp-net-membership-have-a-users-table-and-a-membership-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!