【问题标题】:Using Windows authentication by connecting it with userId, RoleId通过将其与 userId、RoleId 连接来使用 Windows 身份验证
【发布时间】:2014-10-19 13:57:00
【问题描述】:

我有一个 mvc 应用程序,它通过 DefaultConnection 数据库对用户进行身份验证。现在我希望使用 Windows 密码登录的用户可以在我的 mvc 应用程序中自动登录。

我可以用 asp.net mvc 做吗?

感谢您提供的所有建议

【问题讨论】:

    标签: c# asp.net asp.net-mvc


    【解决方案1】:

    如此处所述:- http://www.asp.net/mvc/tutorials/older-versions/security/authenticating-users-with-windows-authentication-cs

    当您创建新的 ASP.NET MVC 应用程序时,Windows 身份验证 默认情况下未启用。表单身份验证是默认设置 为 MVC 应用程序启用的身份验证类型。您必须启用 通过修改 MVC 应用程序的 Web 进行 Windows 身份验证 配置(web.config)文件。找到该部分并 像这样修改它以使用 Windows 而不是 Forms 身份验证:

    <authentication mode="Windows">
    
    </authentication>
    

    欲了解更多信息:- Windows Authentication for ASP.NET MVC 4 - how it works, how to test it

    【讨论】:

    • 非常感谢,我认为这会很有帮助!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-07
    • 1970-01-01
    • 2012-03-29
    • 1970-01-01
    • 2011-01-16
    相关资源
    最近更新 更多