ASP.NET MVC and mixed mode authentication

前端 未结 4 791
情书的邮戳
情书的邮戳 2020-11-27 03:53

I have a scenario whereby I require users to be able to authenticate against an ASP.NET MVC web application using either Windows authentication or Forms authentication. If t

4条回答
  •  面向向阳花
    2020-11-27 04:20

    I know this is an old post - but everything lives forever on the internet!

    Anyway, I had to move an old website from IIS6 to IIS8. This is a WebForms website, but I assume this very simple solution is the same.

    I received the error : Unable to cast object of type 'System.Security.Principal.WindowsIdentity' to type 'System.Web.Security.FormsIdentity'.

    All I did was create a new application pool for the website. When creating this, I set the Managed pipeline mode to 'Classic'. (Read more here - http://www.hanselman.com/blog/MovingOldAppsFromIIS6ToIIS8AndWhyClassicModeExists.aspx) Dont forget to set the website's application pool to the new pool you just created.

提交回复
热议问题