简体   繁体   English

通过Windows身份验证对话框清除用户名缓存

[英]Clear username caching by windows authentication dialogue box

I have an ASP.Net web application that uses windows authentication. 我有一个使用Windows身份验证的ASP.Net Web应用程序。 When I access the application it prompts a windows dialog box to input the credentials and a check box "Remember my credentials" to save the user credentials. 当我访问该应用程序时,它会提示一个Windows对话框输入凭据,并提示“记住我的凭据”复选框以保存用户凭据。 I have the following requirement for the application to ensure security, 为了确保安全性,我对应用程序有以下要求,

The application should clear the "UserName" and "Password" fields on windows authentication dialog box every time he access the application, even though if he selects the "Remember my credentials" check box during in previous login. 每次他访问该应用程序时,该应用程序都应清除Windows身份验证对话框上的“用户名”和“密码”字段,即使他在上次登录过程中选中了“记住我的凭据”复选框也是如此。

I tried creating a registry key "DisablePasswordCaching", but this clears only the password field but not the username. 我尝试创建注册表项“ DisablePasswordCaching”,但这只会清除密码字段,而不会清除用户名。 And this fix should be done in all the client machines which is not a valid option. 并且此修复程序应在所有客户端计算机上完成,这不是有效的选择。

The dialog box is presented by the browser in response to a 401 authentication error that IIS returns when a user attempts to anonymously access a website that has Windows Auth enabled. 当用户尝试匿名访问启用了Windows身份验证的网站时,IIS将返回401身份验证错误,浏览器将显示该对话框。 The dialog is outside the control of your application (it is a feature of the browser), and whether or not you can clear the username, and how to do so, is going to be different for each browser (and possibly versions of the browser). 该对话框不在应用程序的控制范围内(这是浏览器的功能),对于每个浏览器(以及可能的浏览器版本),是否可以清除用户名以及如何清除该用户名都会有所不同。 )。

If it is imperative that you have control over this, then you might want to look at using Forms authentication in conjunction with the Active Directory Roles and Membership provider so you have control over the login screen. 如果必须对此具有控制权,那么您可能希望结合使用表单身份验证和Active Directory角色和成员资格提供程序,以便可以控制登录屏幕。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM