Windows身份验证工作的很好,当我主持我在IIS上的ASP.NET MVC项目。但是,如果我运行这个从Visual Studio - 事实并非如此。
下面是我的web.config:
<身份验证模式=窗口/> <授权> <拒绝用户=? /> < /授权>
我缺少的东西?
解决方案如果你在IIS托管防爆preSS(你可能应该),请确保您已启用Windows身份验证的Web应用程序的性能。
通过,如果你在Visual Studio中的一个新的ASP.NET MVC应用程序4使用你会与下面的自述文件在屏幕上迎来了内联网应用模板的方式。因此,继续前进,尝试它,阅读它,并按照什么写有:
要使用这个模板与Windows Azure的身份验证,请参阅 go.microsoft/fwlink/?LinkID=267940.
否则,使用该模板Windows身份验证,请参阅 下面的说明:
托管在IIS防爆preSS:
托管在IIS 7或更高版本:
要在Windows上启用Windows身份验证:
a)在控制面板中打开程序和功能。 b)选择Windows功能打开或关闭。 C)浏览到Internet Information Services>万维网服务>安全,并确保Windows身份验证节点已选中。
要在Windows Server上启用Windows身份验证:
a)在服务器管理器,选择Web服务器(IIS),然后单击添加角色服务。 B)导航到Web服务器>安全,并确保Windows身份验证节点已选中。
Windows authentication works good when I host my ASP.NET MVC project on IIS. But if I run this from Visual Studio - it doesn't.
Here is my Web.config:
<authentication mode="Windows" /> <authorization> <deny users="?" /> </authorization>Am I missing something?
解决方案If you are hosting in IIS Express (which you probably should), make sure you have enabled Windows Authentication in the properties of your Web Application.
By the way if you create a new ASP.NET MVC 4 application in Visual Studio using the Intranet Application template you will be greeted with the following Readme on the screen. So go ahead, try it, read it and follow what's written there:
To use this template with Windows Azure authentication, refer to go.microsoft/fwlink/?LinkID=267940.
Otherwise, to use this template with Windows authentication, refer to the instructions below:
Hosting on IIS Express:
Hosting on IIS 7 or later:
To enable Windows authentication on Windows:
a) In Control Panel open "Programs and Features". b) Select "Turn Windows features on or off". c) Navigate to Internet Information Services > World Wide Web Services > Security and make sure the Windows authentication node is checked.
To enable Windows authentication on Windows Server:
a) In Server Manager, select Web Server (IIS) and click Add Role Services. b) Navigate to Web Server > Security and make sure the Windows authentication node is checked.
更多推荐
当我从Visual Studio中运行项目中的Windows身份验证不工作
发布评论