Windows身份验证和同一应用程序中的Forms身份验证 [英] Windows authentication and Forms authentication in same application

查看:94
本文介绍了Windows身份验证和同一应用程序中的Forms身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Web应用程序中已经内置了表单身份验证.我可以在同一应用程序中进行Windows身份验证和表单身份验证吗?因此,首先使用Windows身份验证尝试进行身份验证,如果失败,则使用窗体身份验证来完成.

I have forms authentication already built in my web application. Can I have Windows authentication and forms authentication in the same application. So first authentication is tried using Windows authentication and if it fails then it is done using Forms authentication.

推荐答案

可能-确切的机制取决于用户存储区的位置-例如,假设您在数据库中拥有自己的用户表用于进行表单身份验证.在这种情况下,您可以通过将用户映射到Windows用户来提供Windows身份验证-就像维护users表中的列一样简单.

Its possible - exact mechanism would depends upon where your user store is located at - for example, let's say you have your own users table in the database that you are using for doing Forms authentication. In such case, you can offer windows authentication by mapping your user to the windows user(s) - it can be as simple as maintaining a column in the users table.

基本思想是将ASP.NET配置为使用表单身份验证-登录页面使用Windows身份验证,如果用户通过了身份验证,则不显示登录表单.有关更多信息,请参见此链接: http://mvolo.com/iis-70-twolevel-authentication-with-forms-authentication-and-windows-authentication/

Basic idea is to to configure ASP.NET to use forms authentication - the login page uses windows authentication and if user is authenticated then do not display login-form. See this link for more info: http://mvolo.com/iis-70-twolevel-authentication-with-forms-authentication-and-windows-authentication/

在相关说明上,请参见以下SO问题:将Forms身份验证与Windows身份验证混合

On related note, see this SO question: Mixing Forms authentication with Windows authentication

这篇关于Windows身份验证和同一应用程序中的Forms身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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