ASP.NET 成员资格数据表关系
我使用了 ASP.NET 会员资格,并且对其数据表有一些困惑。为什么数据库将 aspnet_Membership 和 aspnet_User 表分开,因为两者都包含用户信息,显然不需要创建不同的表。除此之外,PasswordSalt 令人困惑。请有人解释或分享表关系详细信息的链接?
I used the ASP.NET membership and have some confusions in its data table. Why the database has aspnet_Membership and aspnet_User table separate because both contains the info of user and apparently no need to make different tables. beside this find PasswordSalt confusing. Kindly someone explain or share a link for details of relationships of tables?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是图表: http://superpatrick.wordpress.com/2007 /11/21/aspnet-membership-schema/
会员资格与用户是分开的,因为您可以打开配置文件、授权、Web 部件,但仍可以关闭会员资格。例如,如果您使用 Windows 身份验证(即 Active Directory)作为成员资格存储,则成员资格表将保持未使用状态,并且用户表只需要几列来帮助标识拥有配置文件或 Web 中内容的 Windows 用户。零件表。
Here is the diagram: http://superpatrick.wordpress.com/2007/11/21/aspnet-membership-schema/
Membership is separate from user because you can turn on profile, authorization, web parts and still turn off membership. For example, if you are using windows authentication (i.e. Active Directory) as your membership store, then the membership table is left unused and the user table needs only a few columns to help id the windows user that owns things in the profile, or web parts table.
至于他们为什么这么做,我不太确定。但我可以稍微介绍一下两者之间的关系。
aspnet_users 包含帐户的用户信息。
aspnet_membership 包含登录信息以及与用户的联系。
实际上,这些可能是一张表,当然,但它们确实分隔了用户和密码这两个关键信息。与其他所有系统一样,ASP.NET 系统也是模块化的,您可以启用/禁用不同的功能,并将表分开有助于实现这一点。
在对密码进行加密/哈希处理时,会使用 PasswordSalt 为密码添加额外的随机性,这样即使使用相同的密码,值也不会相同。
As to why they do what they do I'm not really sure on that one. but I can give a little context to the relationships between the two.
aspnet_users contains the user information for the account.
aspnet_membership contains the login info and ties to a user
In all reality could these be one table, sure, but they do separate two key pieces of information the user and the password. Also just like everything else the ASP.NET system is modular in the way that you can enable/disable different features and keeping the tables separate helps with that.
The PasswordSalt is used when encrypting/hashing the password to add additional randomness to the passwords so that even with the same password the values wouldn't be the same.