MVC 3中的自定义身份验证/授权

时间:2012-01-23 16:06:11

标签: asp.net-mvc asp.net-mvc-3 forms-authentication

使用Identity和Principal而不是Custom Membership Provider和Custom RoleProvider有什么好处? 我已实现自定义成员资格提供程序和自定义角色提供程序(阅读本文后: http://www.brianlegg.com/post/2011/05/09/Implementing-your-own-RoleProvider-and-MembershipProvider-in-MVC-3.aspx

但是,我想知道使用Identity和Principal是否是更好的选择。如果是这样,我该怎么办

提前致谢

1 个答案:

答案 0 :(得分:3)

会员提供者与此无关。 FormsAuthentication是IIdentity和Role Provider的提供者,是IPrincipal的一个实现。它们是为您预先编写的。成员资格仅用于进行实际身份验证。

相关问题