HTTP错误404.15 - 未找到...因为查询字符串太长 [英] HTTP Error 404.15 - Not Found ...because the query string is too long

查看:1557
本文介绍了HTTP错误404.15 - 未找到...因为查询字符串太长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我查了很多关于此错误的帖子,但尚无法解决问题。



我在Windows 8 pro上运行的VS2013内置了简单的MVC5网站。创建站点后,将选择单个帐户的选项。我现在需要启用Windows身份验证,以便只有AD帐户用户可以使用该网站和授权,以便我可以限制对特定AD组的某些视图/控制器的访问权限。



在VS中选择了Web项目后,我更新了属性窗口(F4),以便将匿名身份验证设置为禁用,并将Windows身份验证设置为已启用。



Web该项目的.config现在包含以下部分:

 < system.web> 
< authentication mode =Windows/>
< compilation debug =truetargetFramework =4.5/>
< httpRuntime targetFramework =4.5/>
< authorization>
< deny users =? />
< / authorization>
< /system.web>
< system.webServer>
< modules>
< remove name =FormsAuthenticationModule/>
< / modules>
< /system.webServer>

我从IIS或F5访问该网站我收到错误:HTTP错误404.15 - 未找到
请求过滤模块配置为拒绝查询字符串太长的请求。我注意到有些东西已经循环以提供一个ReturnUrl,它是查询字符串中的重复长连接。



在IIS \Authentication部分中,我已设置为禁用匿名身份验证,ASP.Net模拟和表单身份验证。在IIS.Net授权规则部分中,我设置为拒绝匿名用户并允许所有用户



我哪里出错?

解决方案

我个人遇到这个问题的唯一一次是我不小心加了 [授权] 到布局中使用的子操作。在您的登录操作中添加 [授权] 会产生相同的效果,或者只是忽略添加 [AllowAnonymous] 登录操作,当它所在的控制器上有 [授权] 时。多长时间,这是由需要在页面实际登录上进行授权的内容引起的,这会导致您被重定向到登录页面,这需要授权,导致您被重定向到登录页面等。 / p>

tl; dr


  1. 确保登录/登录操作 [授权]

  2. 确保您的登录/登录操作 >拥有 [AllowAnonymous]

  3. 确保您的布局或登录页面中没有使用的子操作 [授权] 或者 [AllowAnonymous] 如果它们位于装饰有 [Authorize]


I've checked lots of posts about this error but not been able to fix the problem yet.

I have simple MVC5 website built in VS2013 running on Windows 8 pro. When the site was created the option for individual accounts was selected. I now need to enable windows authentication so that only AD account users can use the website and also authorisation so that I can limit access to certain views / controllers to particular AD groups.

Having selected the web project within VS I have updated the properties window (F4) so that Anonymous Authentication is set to disabled and Windows Authentication is set to Enabled.

The web.config for the project now contains the following sections:

<system.web>
    <authentication mode="Windows" />
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <authorization>
      <deny users="?" />
    </authorization>
  </system.web>
  <system.webServer>
    <modules>
      <remove name="FormsAuthenticationModule" />
    </modules>
  </system.webServer>

I access the site from IIS or F5 I get the error: HTTP Error 404.15 - Not Found The request filtering module is configured to deny a request where the query string is too long. I notice that something has looped to give a ReturnUrl which is a repeating long concatenation within the query string.

Within the IIS\Authentication section, I have set to disabled "Anonymous Authentication, ASP.Net Impersonisation, and Forms Authentication". Within the section IIS.Net Authorization Rules I have set to Deny "Anonymous Users" and Allow "All Users"

Where am I going wrong?

解决方案

The only time I've personally run into this issue is when I accidentally added [Authorize] to a child action that was used in the layout. Adding [Authorize] to your sign in action would have the same effect or simply neglecting to add [AllowAnonymous] on your sign in action, when the controller it is in has [Authorize] on it. Long and short, this is being caused by something requiring authorization on the actual sign in page, which then causes you to be redirected to the sign in page, which needs authorization, causing you to be redirected to the sign in page, etc.

tl;dr

  1. Make sure your sign in / login action does not have [Authorize].
  2. Make sure your sign in / login action does have [AllowAnonymous].
  3. Make sure no child actions used in your layout or sign in page have [Authorize] or have [AllowAnonymous] if they are in a controller decorated with [Authorize].

这篇关于HTTP错误404.15 - 未找到...因为查询字符串太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆