ASP.NET 成员身份与 SQL 身份验证
对于 ASP.NET MVC Extranet 应用程序,使用 SQL 身份验证而不是 ASP.NET Membership API 来处理安全性有何优缺点?
For ASP.NET MVC extranet applications, what are the pros and cons of using SQL Authentication instead of the ASP.NET Membership API to handle security?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Gern,您正在描述同一框架的各个方面。
asp.net 提供程序堆栈是一个抽象服务层,它为您的应用程序“提供”公共服务。
内置的 Sql 提供程序只是使用 Sql 服务器作为后备存储的实现。 MVC 框架和脚手架提供了使用默认 Sql 提供程序所需的所有适配器。
如果内置的 asp.net sql 提供程序提供了您需要的功能,那么优点是所有工作都已完成。
不知道什么是骗局。
关于您想要比较使用 Sql 提供程序与 AD 提供程序的可能性:
基于 AD/令牌的提供程序 Active Directory 用于身份验证和访问控制,这意味着用户必须在 AD 中设置有效的帐户才能访问受保护的资源。
Sql 提供程序允许您定义不需要 AD 帐户的任意用户。
当您拥有必须支持的大型 AD 用户群但也必须允许建立非 AD 帐户时,就会出现臭名昭著的灰色区域。那时,您将开始探索构建复合提供程序堆栈将给您的生活带来的精致乐趣,同时它会偷走您的睡眠。但这是另一本书的主题。
华泰
Gern, you are describing aspects of the same framework.
The asp.net provider stack is an abstract service layer that 'provides' common services to your applications.
The built in Sql providers are simply implementations that use Sql server as a backing store. The MVC framework and scaffolding provide all of the necessary adapters for using the default Sql providers.
If the built-in asp.net sql providers provide the functionality you require then the pro is that all the work is done.
Not sure what a con would be.
In regards to the possibility that you want to compare using Sql providers vs AD providers:
The AD/Token based providers Active Directory for authentication and access control and the implication is that a user must have a valid account setup in the AD in order to access protected resources.
The Sql providers allow you to define arbitrary users that do not require AD accounts.
The infamous grey zone appears when you have a large AD user base that you must support but must also allow for non-AD accounts to be established. At that point you will start to explore the exquisite joy that building composite provider stacks will bring to your life while it steals your sleep. But that is a topic for another book.
HTH