Windows Authentication not working in ASP.NET MVC 5 web app

前端 未结 2 911
遇见更好的自我
遇见更好的自我 2021-02-07 12:18

I have an ASP.NET MVC 5 app and am trying to enable Windows Authentication. The development machine is Windows Server 2008 R2, IIS Express 8.0, Visual Studio 2013 & .NET Fra

2条回答
  •  醉梦人生
    2021-02-07 13:00

    The ConfigureAuth method in Startup.Auth.cs contained the following code which needed to be removed for Windows Authentication.

    The code is used for Forms Authentication with OWIN.

            // Enable the application to use a cookie to store information for the signed in user
            app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                LoginPath = new PathString("/Account/Login")
            });
            // Use a cookie to temporarily store information about a user logging in with a third party login provider
            app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
    

提交回复
热议问题