在问这个问题之前,我已经尽力在网上搜索了。我在 stackoverflow 上看到过类似的问题,但是很长时间以来都没有得到令人满意的答案。这是回答这个反复出现的问题的又一次尝试。
问题
如何构建一个 ASP.NET MVC 5 网站,对 Intranet 用户使用“Windows Auth”,对 Internet 用户使用“Forms Auth”?我们希望使用 ASP.NET Identity 来完成此任务。此外,我们不想使用 Active Directory 组进行授权。对于 Intranet 用户,我们希望使用 Active Directory 对他们进行身份验证,然后回退到 ASP.NET Identity 来管理他们的角色和其他配置文件数据。
如果我们不要求最终用户选择身份验证方法,那就太好了。 Web应用程序应无缝登录内网用户。他们甚至不应该知道有一个登录屏幕。同样,不应要求互联网用户输入其域凭据。他们应该立即看到基于表单的登录屏幕。
有没有推荐的方法来解决这个问题?或者您能否评论以下是否是正确的解决方案?
http://world.episerver.com/blogs/Dan-Matthews/Dates/2014/8/Mixin-Forms-and-Windows-Authentication/ http://world.episerver.com/blogs/Dan-Matthews/Dates/2014/8/Mixing-Forms-and-Windows-Authentication/
https://github.com/MohammadYounes/MVC5-MixedAuth https://github.com/MohammadYounes/MVC5-MixedAuth
http://mvolo.com/iis-70-twolevel-authentication-with-forms-authentication-and-windows-authentication/ http://mvolo.com/iis-70-twolevel-authentication-with-forms-authentication-and-windows-authentication/
仅供参考这是 2004 年的文章,现在可能没有帮助:https://msdn.microsoft.com/en-us/library/ms972958.aspx https://msdn.microsoft.com/en-us/library/ms972958.aspx