问题描述
我有一种情况,一些用户会需要登录到应用程序(Forms身份验证),而其他人将通过Windows身份验证进行身份验证。要确定是否需要用户登录,我会仰视使用自定义角色/许可实施窗口AD用户的权限。
I have a scenario where some users are going to be required to log into an application (forms authentication), while others will be authenticated via Windows authentication. To determine if a user is required to login, I'll be looking up permissions for the Window AD users using a custom role/permission implementation.
在ASP.NET MVC中,可以设置身份验证配置要么窗口或窗体身份验证。我知道这可能会创建两个应用程序做,但我不喜欢那个选项
In ASP.NET MVC, you can set the authentication configuration to either "Windows" or "Forms authentication". I know this could be done by creating two applications but I don't like that option
我要试图说服我的老板,强迫大家登录都会让我们的生活变得简单许多,但我想我最好检查一下,看看是否有什么好的选择那里。我找不到ASP.NET MVC的一个可能的解决方案。我使用的版本2。
I'm about to try to convince my boss that forcing everyone to login will make our lives a lot simpler but I thought I better check to see if there any good options out there. I couldn't find one possible solution for ASP.NET MVC. I'm using version 2.
任何想法?
推荐答案
您需要记住,ASP.NET MVC是内置在上面ASP.NET运行,所以你仍然可以访问底层的功能,和网络。配置仍然有效,同样因为它为的WebForms。
You need remember that ASP.NET MVC is built right on top to the ASP.NET runtime, so you can still access the underlying features, and the web.config still works the same as it does for WebForms.
我发现这个博客帖子IIS 7.0两个级别的身份验证与窗体身份验证和Windows身份验证由迈克沃洛达尔斯基,他在那里讨论了如何通过创建一个自定义实现这一FormsAuthentication包装HTTP模块。
I found this blog post "IIS 7.0 Two-Level Authentication with Forms Authentication and Windows Authentication" by Mike Volodarsky, where he discusses how you can achieve this by creating a custom FormsAuthentication wrapper HttpModule.
我还没有尝试过,但我看不出为什么这会不会与ASP.NET MVC应用程序。
I haven't tried it, but I see no reason why this wouldn't work with an ASP.NET MVC application.
这篇关于是否有Windows身份验证和Forms身份验证在ASP.NET MVC结合起来的好方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!