gpt4 book ai didi

asp.net - 如何强制使用本地 asp.net 开发服务器进行 Windows 身份验证?

转载 作者:可可西里 更新时间:2023-11-01 14:14:15 25 4
gpt4 key购买 nike

我正在开发一个需要 Windows 身份验证的 ASP.NET 应用程序。我将 web.config 设置为拒绝匿名用户并使用 Windows 模式进行身份验证,但我的本地开发版本仍然允许我直接访问该站点。为了测试不同的用户设置,我需要强制授权才能更改用户。

当我在本地 asp.net 开发服务器上运行时,如何设置我的系统(配置文件、VS2005 设置、IIS 等?)以强制在站点上弹出授权窗口?换句话说,如何在 Debug模式下运行网站时获得身份验证弹出窗口?

最佳答案

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

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

将您的应用程序配置为指向 IIS

  1. 右键单击您的 Web 项目,然后单击“属性”
  2. 点击网络标签
  3. 单击“使用本地 IIS Web 服务器”单选按钮

关于asp.net - 如何强制使用本地 asp.net 开发服务器进行 Windows 身份验证?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1143960/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com