Is there a good approach to combine Windows authentication and Forms authentication in ASP.NET MVC?

后端 未结 1 359
南方客
南方客 2021-01-19 00:30

I have a scenario where some users are going to be required to log into an application (forms authentication), while others will be authenticated via Windows authentication.

相关标签:
1条回答
  • 2021-01-19 01:14

    You need remember that ASP.NET MVC is built right on top to the ASP.NET runtime, so you can still access the underlying features, and the web.config still works the same as it does for WebForms.

    I found this blog post "IIS 7.0 Two-Level Authentication with Forms Authentication and Windows Authentication" by Mike Volodarsky, where he discusses how you can achieve this by creating a custom FormsAuthentication wrapper HttpModule.

    I haven't tried it, but I see no reason why this wouldn't work with an ASP.NET MVC application.

    0 讨论(0)
提交回复
热议问题