windows 内网ASP.NET网站的Windows认证,重新出现windows登录框

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5419232/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 16:29:58  来源:igfitidea点击:

Windows authentication of Intranet ASP.NET website and reappearing windows login box

asp.netwindowsauthenticationintranet

提问by Mjakda

I'm trying to enable automatic Window authentication working on our ASP.NET Intranet. I've changed the Authentication on our IIS 7.5 server from Anonymous to Windows Authentication Enabled only, and changed the Web.config file for the website to:

我正在尝试在我们的 ASP.NET Intranet 上启用自动 Window 身份验证。我已将 IIS 7.5 服务器上的身份验证从匿名更改为仅启用 Windows 身份验证,并将网站的 Web.config 文件更改为:

<authentication mode="Windows" />
 <authorization>
    <deny users="?" />
 </authorization>

The Windows login box appears when accessing the website via IE 8, I enter valid credentials, but the login window keeps reappearing as if it does not accept my credentials. By repeatedly cancelling the login box it disappears, and my login name can be viewed on the website. Is there any possible reason for the login box to keep popping up even though valid credentials are being entered? I've restarted the servers / cleared browser cache etc.

通过 IE 8 访问网站时会出现 Windows 登录框,我输入了有效的凭据,但登录窗口不断重新出现,就好像它不接受我的凭据一样。通过反复取消登录框,它会消失,并且可以在网站上查看我的登录名。即使输入了有效的凭据,登录框是否有任何可能的原因仍然弹出?我已经重新启动了服务器/清除了浏览器缓存等。

Also, ideally I would like the user to enter the login details once in the login box and not be required to reenter login details whenever he reopens the browser.

此外,理想情况下,我希望用户在登录框中输入一次登录详细信息,而无需在他重新打开浏览器时重新输入登录详细信息。

回答by Dante

Check if your browser has "Enable Integrated Windows Authentication" checked. In IE it's in the Advanced options.

检查您的浏览器是否选中了“启用集成 Windows 身份验证”。在 IE 中,它位于高级选项中。

回答by PPC-Coder

You should be able to configure it so you don't have to see the login prompt at all. IIS seems to be configured correctly since it's asking you for credentials. So I would test out the browser settings. Some things I would check for are that:

您应该能够对其进行配置,因此您根本不必看到登录提示。IIS 似乎配置正确,因为它要求您提供凭据。所以我会测试浏览器设置。我要检查的一些事情是:

  1. Make sure that your browser recognizes the site as being in your Intranet. You should see the "Intranet" zone icon near the right side of your status bar.
  2. If not, you should add it to your list of local sites.
  3. Check that your credentials are being passed to sites in the local intranet.
  4. Make sure your links are all consistent, for example if you use a different DNS name or access by IP, the browser won't necessarily know they belong to the same site and try to reauthenticate.
  1. 确保您的浏览器将该站点识别为位于您的 Intranet 中。您应该会在状态栏右侧附近看到“Intranet”区域图标。
  2. 如果没有,您应该将其添加到本地站点列表中。
  3. 检查您的凭据是否正在传递到本地 Intranet 中的站点。
  4. 确保您的链接都是一致的,例如,如果您使用不同的 DNS 名称或通过 IP 访问,浏览器不一定知道它们属于同一站点并尝试重新验证。

Something else that might be going on is if you're trying access resources that you're account isn't allowed to. So make sure that isn't happening. I'm wondering since you said hitting cancel gets your page to show the login name.

可能发生的其他事情是,如果您尝试访问您的帐户不允许的资源。因此,请确保不会发生这种情况。我想知道因为你说点击取消会让你的页面显示登录名。