ASP.NET成员资格的替代品 [英] ASP.NET Membership Alternatives

查看:108
本文介绍了ASP.NET成员资格的替代品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直从asp.net成员避之不及,因为它似乎有些力不从心,和(当时)不可测。在asp.net MVC明确的情况下,有没有人使用替代解决方案,给用户分配角色,并存储登录用户的一些附加信息?任何建议?是不是疯了,只是推出自己的,只实现你需要的功能?

I have always stayed away from asp.net membership as it seemed bloated, and (at the time) untestable. In the case of asp.net MVC specifically, does anyone use an alternative solution for assigning roles to users, and storing some addition information for the logged in user? Any recommendation? Is it crazy to just roll your own, just implementing the functionality you need?

推荐答案

ASP.NET成员使用的存储供应商的模式。 SqlMembershipProvider的继承了加密/从抽象的MembershipProvider类散列密码功能。但你也可以从继承的MembershipProvider并获得该功能的自定义提供,如果你想要的。

ASP.NET membership uses a provider model for the storage. SqlMembershipProvider inherits encrypting/hashing password functionality from the abstract MembershipProvider class. But you could also inherit from MembershipProvider and get that functionality in a custom provider if you wanted.

如果您使用SqlMembershipProvider的,你以饱满的密码管理(检查,更换,重置密码无效尝试)和用户管理一个完全工作的会员数据库(CRUD OPS,锁定了用户)。

If you use the SqlMembershipProvider, you get a fully working membership database with full password management (checking, changing, resetting, invalid password attempts) and user management (CRUD ops, locking out users).

所有这些是在一个API级。你可以创建你想对API的任何用户界面。

All of that is at an API level. You can create whatever UIs you want against the API.

使用SqlMembershipProvider的不要求您使用角色提供程序或配置文件提供程序或任何其他的东西,你可以滚你自己的,而不会影响会员的那些东西。至少,我会建议使用经过良好测试的SqlMembershipProvider作为安全为基本的东西的核心。

Using the SqlMembershipProvider doesn't require you to use the Roles Provider or the Profile Provider or any of that other stuff, and you can roll your own for those things without impacting membership. At the very least I would recommend using the well-tested SqlMembershipProvider as the core of your security for the basic stuff.

这篇关于ASP.NET成员资格的替代品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆