asp.net Windows身份验证:用户通过Chrome登录登录提示 [英] asp.net Windows Authentication: users pass through logon prompt with Chrome

查看:239
本文介绍了asp.net Windows身份验证:用户通过Chrome登录登录提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用Windows身份验证的ASP.NET MVC 4 Web应用程序。



在Internet Explorer(IE),Fire Fox(FF)和Safari中,Windows身份验证的效果与我的预期相符:用户首先看到登录提示对话框,提供有效的凭据,他们可以查看我的页面。



但是在使用Chrome进行测试时,我发现Chrome没有向用户显示登录提示对话框,因为我看到了IE,FF和Safari。相反,它只是让用户立即通过并查看我的页面! Chrome的这种行为不是我想要的。我真的希望Chrome首先显示登录提示对话框,下一个用户必须提供有效凭据,最后他们可以查看页面。



我的问题:

如何阻止Chrome自动让用户通过登录提示对话框? Chrome必须与IE,FF或Safari一样显示登录对话框。



请帮忙。





我的代码和IIS设置正在使用IE,FF和Safari,如下所示:



1)对于我的web.config文件,我配置为:



I have an ASP.NET MVC 4 web application that applies Windows Authentication.

In Internet Explorer (IE), Fire Fox (FF) and Safari, that Windows Authentication works well as my expectation: users see a logon prompt dialog first, after they provide valid credentials, they are able to view my pages.

But when testing with Chrome, I see Chrome does not show the logon prompt dialog to users as I see with IE, FF, and Safari. Instead, it simply lets users pass through and view my pages immediately! That behavior of Chrome is not what I want. I really want Chrome to show the logon prompt dialog first, next users must provide valid credentials, and finally they can view pages.

My question:
How can I prevent Chrome from auto letting users pass through the logon prompt dialog? Chrome must show the logon dialog as with IE, FF, or Safari.

Please help.


My codes and IIS setup are working with IE, FF and Safari as I do as following:

1) For my web.config file, I configure as:

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





2)在托管我部署的MVC 4应用程序站点的服务器上使用IIS 7,我启用了Windows身份验证和禁用匿名身份验证。



3)对于经过测试的MVC控制器,我在操作甚至控制器上修饰[Authorize]。



2) And with IIS 7 on the server hosting my deployed MVC 4 application site, I enable Windows Authentication and disable Anonymous Authentication.

3) For tested MVC controllers, I decorate [Authorize] on actions and even controllers as well.

推荐答案

登录对话框是您不应该想要的。如果您需要Windows身份验证和表单,则应使用窗口身份验证提供程序。

您看到的对话框是因为身份验证在IIS中设置为BASIC,或者首先设置为BASIC。您命名的pass-trough是使用NTLM(或域中的Kerberos)的真实窗口身份验证。

但是,如果您坚持看到该对话框,请务必仅使用BASIC身份验证(请参阅: http://technet.microsoft.com/en-us/library/cc772009(v = ws.10).aspx [ ^ ])。
The logon dialog is something you should not want. If you want windows authentication and a form, you should use forms authentication with a windows membership provider.
The dialog you see, is because the authentication is set in IIS to BASIC, or BASIC first. The pass-trough as you named it is the "real" window authentication that is using NTLM (or Kerberos in a domain).
Still, if you stick to see that dialog, be sure to use BASIC authentication only (see: http://technet.microsoft.com/en-us/library/cc772009(v=ws.10).aspx[^]).


这篇关于asp.net Windows身份验证:用户通过Chrome登录登录提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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