如何强制与当地asp.net开发服务器的Windows身份验证? [英] How do I force windows authentication with local asp.net development server?

查看:82
本文介绍了如何强制与当地asp.net开发服务器的Windows身份验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发展,需要Windows身份验证的ASP.NET应用程序。我有web.config中设置为拒绝匿名用户使用Windows模式进行身份验证,但我的本地开发版仍然让我的权利通过到现场。为了测试不同的用户设置窗口,我需要强制授权,这样我就可以改变用户。

如何设置我的系统(配置文件,VS2005设置,IIS等?)来强制授权窗口时,我的本地asp.net开发服务器上运行的网站上弹出?换句话说,我怎么运行在调试模式下时,现场的验证弹出?


解决方案

您还需要配置IIS和你的应用程序指向IIS,而不是本地Web服务器


  

要配置Windows身份验证


  
  

      
  1. 启动Internet Information Services(IIS)。

  2.   
  3. 右键单击应用程序的虚拟目录,然后单击属性。

  4.   
  5. 单击目录安全性选项卡。

  6.   
  7. 在匿名访问和验证控制,单击编辑。

  8.   
  9. 确保匿名访问复选框未选中,并且集成Windows>认证是唯一选中的复选框。

  10.   

http://msdn.microsoft.com/en-us/library/ ms998358.aspx

要配置应用程序指向IIS


  1. 右键点击你的Web项目,然后单击属性

  2. 点击网页标签

  3. 单击使用本地IIS Web服务器单选按钮

I'm developing an ASP.NET application which needs Windows Authentication. I have the web.config set up to deny anonymous users and use Windows mode for authentication, but my local development version still lets me pass right through to the site. In order to test different user set-ups, I need to force authorization so I can change users.

How do I set up my system (config files, VS2005 settings, IIS, etc?) to force the authorization window to popup on the site when I'm running on local asp.net development server? In other words, how do I get the authentication popup when running the site in Debug mode?

解决方案

You will also need to configure IIS and have your application point to IIS instead of the local web server

To configure Windows authentication

  1. Start Internet Information Services (IIS).
  2. Right-click your application's virtual directory, and then click Properties.
  3. Click the Directory Security tab.
  4. Under Anonymous access and authentication control, click Edit.
  5. Make sure the Anonymous access check box is not selected and that Integrated Windows > authentication is the only selected check box.

http://msdn.microsoft.com/en-us/library/ms998358.aspx

To configure your application to point to IIS

  1. Right click on your web project, and then click Properties
  2. Click the Web tab
  3. Click the "Use Local IIS Web Server" radio button

这篇关于如何强制与当地asp.net开发服务器的Windows身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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