forms authentication gives a too long query string

This question already has an answer here:

  • ASP.NET MVC 5 : Endless redirect to the login page using the site template 1 answer

  • You should use attributes instead of web.config configuration to authorize your mvc application. Web config configuration should be used only with web form applications.

    Decorate your Login action (both get and post version) with [AllowAnonymous] attribute.

    User [Authorize] attribute for other controllers.

    Read this article to see how to secure your mvc application.

    Update

    I reproduced your problem locally with default mvc project and i had this in my web.config:

    <system.webServer>
        <modules>
          <remove name="FormsAuthentication" />
        </modules>
    </system.webServer>
    

    Everything started working after i commented the <remove name="FormsAuthentication" /> part

    链接地址: http://www.djcxy.com/p/7258.html

    上一篇: 返回View()并返回PartialView()神秘MVC5

    下一篇: 表单身份验证会提供太长的查询字符串