Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 505
chobo2 Avatar asked Sep 28 '09 23:09

chobo2


2 Answers

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.

like image 66
Rex M Avatar answered Sep 22 '22 00:09

Rex M


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

like image 37
Paul Abbott Avatar answered Sep 23 '22 00:09

Paul Abbott