ASP.NET MVC和混合模式身份验证 [英] ASP.NET MVC and mixed mode authentication

查看:301
本文介绍了ASP.NET MVC和混合模式身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个场景,由此我需要用户能够反对使用Windows身份验证或窗体身份验证的ASP.NET MVC Web应用程序进行身份验证。如果用户是在内部网络上,他们将使用Windows身份验证,如果他们连接在外部,他们将使用Forms身份验证。我见过不少人问这个问题我怎么配置这个一个ASP.NET MVC的Web应用程序,但我还没有找到一个完整的解释。

I have a scenario whereby I require users to be able to authenticate against an ASP.NET MVC web application using either Windows authentication or Forms authentication. If the user is on the internal network they will use Windows authentication and if they are connecting externally they will use Forms authentication. I’ve seen quite a few people asking the question how do I configure an ASP.NET MVC web application for this, but I haven’t found a complete explanation.

请有人可以提供详细的解释,用code实例,这将如何做?

Please can someone provide a detailed explanation, with code examples, on how this would be done?

感谢。

艾伦牛逼

推荐答案

这就是所谓混合身份验证模式。基本上你不能一个的的应用程序中,因为在IIS一旦您设置Windows身份验证的虚拟目录,将不再接受来自不同领域的用户实现这一目标。所以基本上你需要有使用窗体身份验证两个应用程序,先用Windows身份验证和第二个(主要应用)。第一个应用程序将包括这将仅仅通过发出身份验证票证域用户重定向到主应用程序的单一地址。

This is called mixed authentication mode. Basically you cannot achieve this within a single application because in IIS once you set up Windows authentication for a virtual directory it will no longer accept users from different domains. So basically you need to have two applications, the first with Windows Authentication and the second (the main application) using Forms authentication. The first application will consist of a single address which will simply redirect to the main application by issuing an authentication ticket for the domain user.

这篇关于ASP.NET MVC和混合模式身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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