ASP.NET MVC3 and Windows Auth on IIS keeps redirecting to /Account/Login

后端 未结 13 2781
没有蜡笔的小新
没有蜡笔的小新 2020-11-28 03:27

I\'m running MVC3 and a windows auth web application. When I deploy to IIS6 it runs great until I hit a page that requires authentication. It then is auto-redirecting to /

相关标签:
13条回答
  • 2020-11-28 03:29

    Try override WebMatrix.dll default for login url by adding this to your appSettings (web.config) :

    <add key="loginUrl" value="~/Account/LogOn"/>
    

    WebMatrix.dll set the login Url to /Account/Login, if this key isn't set in the config file... It works for me.

    0 讨论(0)
  • 2020-11-28 03:30

    Not sure if you still have the issue or not, but try adding

    <add key="autoFormsAuthentication" value="false" />
    

    to your web.config under appSettings. According to here and here, that should solve your problem.

    0 讨论(0)
  • 2020-11-28 03:34

    In RTM try to add to <appSettings> in Web.config:

    <add key="enableSimpleMembership" value="false" />
    

    (Thx to Problem exclusively using Windows Authentication in ASP.NET MVC 3 Beta.)

    0 讨论(0)
  • 2020-11-28 03:39

    You can also go to the IIS on the server and go into Authentication modes and disable forms authentications.

    This has me scratching my head in a demo. Embarassing.

    0 讨论(0)
  • 2020-11-28 03:42

    In RTM try to add to in Web.config:

    <add key="enableSimpleMembership" value="false" />
    

    The above post works. +1 Add this key before adding deployable dependencies.

    0 讨论(0)
  • 2020-11-28 03:43

    In MVC for the 4.6 Framework this is done in 2 ways, the first is in the Web.Config as you would expect, the second one is done in the projectfile and is used to configure IIS Express:

    <PropertyGroup>
    ..
        <IISExpressAnonymousAuthentication>enabled</IISExpressAnonymousAuthentication>
        <IISExpressWindowsAuthentication>disabled</IISExpressWindowsAuthentication>
    </Property
    

    Will disable Windows authentication and use anonymous when developing but is not used for the deploying the application.

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